This directory now supports the current discovery data flow:
sync-kv.tspulls DISCOVERY KV rows into the repo's per-domaindomains/tree.load-kv.tsseeds local KV from a directory ofStoredDiscoveryJSON rows during development.validate-results.tsis a manual data-quality tool for thedomains/tree or a localStoredDiscoveryrow directory.
All commands are Bun scripts and support --help.
bun scripts/batch/sync-kv.ts --dry-run
bun scripts/batch/sync-kv.tsUse --local to read local Wrangler KV instead of production KV:
bun scripts/batch/sync-kv.ts --local --dry-runThe sync writes domains/<canonical-domain>/integrations.json. It unions by canonical domain, keeps the repo copy when KV has no row for that domain, and only replaces an existing file when the incoming row has a newer discoveredAt.
Rejected domains never enter: the sync drops incoming rows for denylisted
domains and junk hosting hosts (*.vercel.app, *.run.app, …), counts them in
the summary, and deletes any domains/ file left over for a denylisted domain.
Deleting domains/<domain>/integrations.json does not reject anything. The
row is still in KV, so the next nightly sync writes the file back.
To reject a record, add it to catalog-denylist.json at the repo root:
One entry is enough. The next sync removes the file, the build and the render
paths skip the domain, and bun run validate:batch fails if a file for a
denylisted (or junk-host) domain reappears. An entry also covers subdomains.
Validate the repo catalog tree:
bun run validate:batchValidate a local directory of full StoredDiscovery rows before loading KV:
bun scripts/batch/validate-results.ts --results-dir path/to/resultsThe validator checks bad URL slugs, duplicate surfaces, missing auth status, and missing locators required by the surface detail page.
bun scripts/batch/load-kv.ts --dir path/to/results --dry-run
bun scripts/batch/load-kv.ts --dir path/to/resultsThe loader defaults to local KV. Production writes require --remote; remote rows are not overwritten unless --overwrite is passed.
export-catalog.ts is a manual importer for a directory of StoredDiscovery rows:
bun scripts/batch/export-catalog.ts --results-dir path/to/resultsIt writes compact per-domain files into domains/ and omits credentials, notes, and other discovery-only details.
{ "domain": "example-host.run.app", "reason": "Why this is not a real record.", "addedAt": "2026-09-21" }