com um clique
debugging-playbook
// Playbook for diagnosing Searchlite issues across CLI/HTTP, storage, and indexing; use when triaging failures or odd search results.
// Playbook for diagnosing Searchlite issues across CLI/HTTP, storage, and indexing; use when triaging failures or odd search results.
Use when implementing or updating Searchlite features that need pre-review hardening via per-feature invariant matrix maintenance, adversarial/regression coverage updates, and full quality-gate verification.
Send local completion notifications to the Agent Notifications app via POST http://127.0.0.1:60766/agent/notify after finishing a task; include title, content, and agent details so the desktop app shows a system notification.
Send local completion notifications to the agent-notifier service via POST http://127.0.0.1:60766/agent/notify after finishing a task; include title, content, and agent details so the desktop app shows a system notification.
Structured workflow for discovering, reproducing, and fixing bugs in Searchlite by inspecting real code paths (CLI/HTTP/core), validating durability invariants, and producing regression tests; use when investigating incorrect results, crashes, data loss risks, or “it sometimes fails” reports.
Guardrails for keeping the Searchlite Rust workspace compliant with formatting, lint, build, test, and perf expectations; use when preparing or reviewing changes to ensure they meet project quality bars.
Style guide for writing Searchlite documentation and examples; use when creating or editing docs/ guides.
| name | debugging-playbook |
| description | Playbook for diagnosing Searchlite issues across CLI/HTTP, storage, and indexing; use when triaging failures or odd search results. |
Searchlite is a single-index, single-writer system with:
Most “weirdness” is one of:
fast fields for filters/aggs)Identify surface area
Capture exact versions + features
vectors changes behavior materially)Get a minimal reproduction
Check index state
searchlite inspect <index> and searchlite compact <index>GET /inspect, GET /stats, optionally POST /compactConfirm lifecycle steps
commitrefresh for immediate visibilityCommon causes:
doc_id_field, default _id)commitChecklist:
searchlite add …searchlite commit …searchlite inspect <index>searchlite search <index> --q "..." --return-stored (or request JSON with return_stored: true)searchlite compact <index>Filters and aggregations depend on fast fields.
"fast": true in schema.fast too and use Nested filters properly.HTTP server has no auth / no rate limiting; don’t expose it to untrusted networks. When debugging production-ish behavior, always capture:
--bind / SEARCHLITE_BIND_ADDR)--index / SEARCHLITE_INDEX_PATH)--max-body-bytes--max-concurrency--request-timeout-secs--refresh-on-commitWrites issued via:
POST /add (NDJSON streaming)POST /bulk (JSON bulk)POST /delete…are queued and only become durable/searchable after:
POST /commitThen visibility depends on staleness needs:
--refresh-on-commit is enabled, new data becomes visible immediatelyPOST /refreshPOST /refresh — reload readersPOST /compact — merge segments + clean up fragmentationGET /inspect — manifest + segments infoGET /stats — doc/segment countsAll errors return:
{"error":{"type":"...","reason":"..."}}If you see a 413/timeout-ish behavior:
--max-body-bytes and --request-timeout-secsSearch supports explicit debugging aids:
explain: trueprofile: trueBoth are off by default for overhead reasons.
profile: true on the request and capture the profile blob.execution=bm25 (baseline full scoring)execution=wand (default exact pruning)execution=bmw (block-max pruning)fastvectors):
candidate_size/ef_search increases recall but costs CPUCommon causes:
Knobs to tune:
candidate_size (oversampling)ef_search (beam width)vector_filter (reduce candidate set)Key rule: nested filters are evaluated per object, not across the entire document.
Correct pattern:
Nested with pathNested inside the parent nested filterCommon gotcha:
fast: trueSymptoms:
Remember the documented crash window:
Fix:
compact (CLI or HTTP) to merge and clean upexecution, profile, explain if relevant)inspect + stats