The host ships a set of pnpm scripts that wrap shell scripts under scripts/. The shell scripts are the canonical implementation; the pnpm alias is just a typed entry point. These are operator scripts — they manage the host process, its database, and its deployment.
Most backfill and sweep scripts are dry-run by default: they report what they would do, and only write when you add --execute. Per-environment variants (:dev / :staging / :prod) mirror db:migrate:<env>.
Run migrations against a specific env (dev / staging / prod)
pnpm db:seed
Tiny hand-written CI fixture (a handful of entities)
pnpm db:seed:<env>
Same, scoped to an env
pnpm db:seed:eval
Realistic sam-rivera fixture (~30 entities, ~90 daily notes) for evals
pnpm db:reset:dev / :staging
Truncate + reseed
pnpm db:studio
Drizzle Studio (browser-based DB inspector)
There is intentionally no pnpm db:reset:prod. Wiping prod is deliberately awkward — you have to type the underlying command, with its guard environment variable, by hand.
Full end-to-end smoke against a throwaway scratch database (a real host subprocess)
pnpm smoke:prod --url <host>
Read-only liveness smoke against a deployed host — used by deploy:prod as the post-deploy gate
pnpm smoke:mcp
Exercise the MCP retrieval tools in-memory (no DB, no LLM)
pnpm eval:agent
Agent-eval harness — deterministically replays scripted retrieval trajectories and scores recall, answer overlap, and path efficiency
pnpm eval:skills
Replays each registered skill’s golden fixtures (including ask-knowledge’s set) and scores per-category accuracy
pnpm eval:chat
Host-native chat eval — multi-turn coherence, local-model tool-calling, and degraded-fallback legs (needs a live model; skips cleanly without one)
pnpm eval:multimodal
Cross-modal (text ↔ image) retrieval eval
pnpm eval:memory
Memory-network retrieval eval
pnpm eval:miss-rate
Retrieval miss-rate harness over a labeled corpus
pnpm eval:unified-primary
A/B eval for the unified embedding-space migration
Each eval:* script has a paired eval:*:check form that runs as a regression gate: it replays against the committed baseline and exits non-zero on a meaningful drop, without writing a new baseline. A deliberate change is recorded by re-running the plain eval:* script and committing the refreshed baseline.
Retroactive one-shot scripts that bring already-ingested data up to a newer pipeline. All are dry-run by default — add --execute to write, and --workspace=<uuid> to scope to one workspace. A few of the common ones:
Script
What it does
pnpm backfill:doc-extraction
Re-enqueue already-ingested documents that never had their text extracted
pnpm backfill:image-text
Re-enqueue image attachments for vision OCR so screenshots of documents become searchable text
pnpm backfill:doc-dates / backfill:photo-dates
Backfill authoritative document / photo capture dates for recency ranking
pnpm reindex:imported-daily-notes
Re-index imported daily-note content into the retrieval substrate
pnpm sweep:edge-confidence
Demote vacuous knowledge-graph edges to their confidence caps
pnpm sweep:code-identifier-entities
Clear leaked source-code identifiers from the entity graph and curation queue
pnpm sweep:apple-files-junk
Purge code/build/data junk artifacts that leaked in via Apple Files indexing
The full per-script flag reference lives in the host’s operations docs.