AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.
Rust agent-memoryai-agentsbm25claude-codeclicode-searchcursordatabaseelasticsearchfull-text-searchhybrid-searchjsonllocal-firstmcpmcp-servermodel-context-protocolragrustsearch-enginevector-search
Merge reviewed autoindex completion and missing-dataset checks
xerj-orgdc39b4d12c12
diff --cc content/answers/autoindex-exit-codes.mdindex b635a7053,02893cd3e..418c7ffab--- a/content/answers/autoindex-exit-codes.md+++ b/content/answers/autoindex-exit-codes.md@@@ -68,10 -68,10 +68,10 @@@ faq- q: "Why did my run print no terminal line at all?"a: "Either `--quiet` or `--progress none` was in force, which prints no terminal line, or the process was killed by a signal. A missing terminal line after the process is gone means it died, not that it finished."- q: "Which codes should an agent retry?"- a: "Retry nothing on 0 or 3. Re-run with `--approve` on 4. Fix the command line on 2. Investigate the endpoint and the journal on 1, because a blind retry repeats the same refusal. The one exit 1 to rerun unchanged is `reason=server-backpressure`, once the node accepts writes again: it resumes with the operations that remain."+ a: "Do not blindly retry 0 or 3. Exit 3 with stale-resume-plan requires a --fresh rebuild to include the new files. Re-run with `--approve` on 4. Fix the command line on 2. Investigate the endpoint and the journal on 1, because a blind retry repeats the same refusal. The one exit 1 to rerun unchanged is `reason=server-backpressure`, once the node accepts writes again: it resumes with the operations that remain."---- **TL;DR** — Exit 3 is a success. `xerj autoindex` exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded `--max-minutes` and nothing was indexed. Exit 2 is a usage error, and exit 1 is an endpoint or journal failure. Only 4 is a question.-**TL;DR** — Read the terminal reason as well as the exit code. Exit 3 with `completed-with-junk` is success; `stale-resume-plan` has `ok=false` because new files were not indexed and needs a `--fresh` rebuild. `xerj autoindex` exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded `--max-minutes` and nothing was indexed. Exit 2 is a usage error, and exit 1 is a runtime failure. Only 4 is a question.++**TL;DR** — Read the terminal reason as well as the exit code. Exit 3 with `completed-with-junk` is success. With `stale-resume-plan`, `ok=false` means new files were not indexed. Rebuild with `--fresh` to include them. `xerj autoindex` exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded `--max-minutes` and nothing was indexed. Exit 2 is a usage error, and exit 1 is a runtime failure. Only 4 is a question.## The codes, as the binary states them@@@ -127,9 -136,9 +136,9 @@@ A person at a terminal is prompted inst`xerj autoindex` never waits on stdin for a question it did not print.- ## Exit 1 and exit 2 are narrower than "any error"+ ## Read the error before retrying exit 1 or 2- The common shorthand is that 1 means any error. The binary is more specific, and the difference matters to a retry policy.-Exit 1 covers runtime failures. Exit 2 identifies a usage error. The diagnostic tells you what needs to change.++Exit 1 covers runtime failures. Exit 2 identifies a usage error. The diagnostic identifies the required change.`2 usage` is a bad command line. Nothing ran, and a retry of the same command will fail the same way.diff --cc landing/answers/autoindex-exit-codes.htmlindex dd5a34d59,b130a28b8..2bd88a316--- a/landing/answers/autoindex-exit-codes.html+++ b/landing/answers/autoindex-exit-codes.html@@@ -232,17 -232,17 +232,17 @@@<div class="breadcrumb"><a href="/">HOME</a><span class="sep">·</span><a href="/answers/">ANSWERS</a><span class="sep">·</span>THE INDEXER EXITED 3 (OR 4). DID IT FAIL?</div><div class="kicker"><span>ANSWERS · OPERATIONS: EXIT CODES</span></div><h1>The indexer exited 3 (or 4). Did it fail?</h1>- <div class="source-note">AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-08-22 · UPDATED · 2026-10-24</div>+ <div class="source-note">AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-08-22 · UPDATED · 2026-10-28</div><div class="prompt-card answer-first" id="short-answer">- <span class="prompt-label">SHORT ANSWER · UPDATED 2026-10-24</span>- <p>What does indexer exit code 3 mean for xerj autoindex? It means success: the run completed and recorded some junk files. Exit 0 is a clean completion, 4 means the estimate exceeded --max-minutes and nothing was indexed, 2 is a usage error, and 1 is an endpoint or journal failure. Only exit 4 asks you a question.</p>+ <span class="prompt-label">SHORT ANSWER · UPDATED 2026-10-28</span>+ <p>Exit 3 means the run finished with an outcome to inspect. Completed-with-junk is success; stale-resume-plan carries ok=false because new files were not indexed and needs a --fresh rebuild. Exit 0 is completion or cancellation, 4 needs approval, 2 is usage, and 1 is a real failure. Read the terminal reason and refusal counts before reporting coverage.</p><p class="key-fact"><strong>Key number:</strong> The decision gate that produces exit 4 defaults to 10 minutes of estimated work (<code class="inline">DEFAULT_MAX_MINUTES</code>). <span class="mute">(as of 2026-10-19 · source: <a href="https://github.com/xerj-org/xerj/blob/main/engine/crates/xerj-autoindex/src/gate.rs">engine/crates/xerj-autoindex/src/gate.rs</a>)</span></p></div>- <p><strong>TL;DR</strong> — Exit 3 is a success. <code class="inline">xerj autoindex</code> exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded <code class="inline">--max-minutes</code> and nothing was indexed. Exit 2 is a usage error, and exit 1 is an endpoint or journal failure. Only 4 is a question.</p>- <p><strong>TL;DR</strong> — Read the terminal reason as well as the exit code. Exit 3 with <code class="inline">completed-with-junk</code> is success; <code class="inline">stale-resume-plan</code> has <code class="inline">ok=false</code> because new files were not indexed and needs a <code class="inline">--fresh</code> rebuild. <code class="inline">xerj autoindex</code> exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded <code class="inline">--max-minutes</code> and nothing was indexed. Exit 2 is a usage error, and exit 1 is a runtime failure. Only 4 is a question.</p>++ <p><strong>TL;DR</strong> — Read the terminal reason as well as the exit code. Exit 3 with <code class="inline">completed-with-junk</code> is success. With <code class="inline">stale-resume-plan</code>, <code class="inline">ok=false</code> means new files were not indexed. Rebuild with <code class="inline">--fresh</code> to include them. <code class="inline">xerj autoindex</code> exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded <code class="inline">--max-minutes</code> and nothing was indexed. Exit 2 is a usage error, and exit 1 is a runtime failure. Only 4 is a question.</p><div class="prompt-card"><span class="prompt-label">PASTE THIS TO YOUR AI AGENT — IT DOES THE REST</span>- <code>Act as a coding agent. Read https://xerj.org/llms.txt, run xerj autoindex on the folder, then branch on the process exit code before you report anything: 0 and 3 are finished runs, 4 is a decision request on stdout that you answer with --approve, 2 is a bad command line, and 1 is a real failure to retry or escalate.</code>- <button type="button" class="prompt-copy" data-copy="Act as a coding agent. Read https://xerj.org/llms.txt, run xerj autoindex on the folder, then branch on the process exit code before you report anything: 0 and 3 are finished runs, 4 is a decision request on stdout that you answer with --approve, 2 is a bad command line, and 1 is a real failure to retry or escalate.">COPY THE PROMPT</button>+ <code>Read https://xerj.org/llms.txt, then inspect the terminal reason as well as the exit code. Exit 3 with stale-resume-plan has ok=false and needs --fresh; completed-with-junk requires reading the refusal list. Answer exit 4 with --approve, correct usage on 2, and investigate the error on 1.</code>+ <button type="button" class="prompt-copy" data-copy="Read https://xerj.org/llms.txt, then inspect the terminal reason as well as the exit code. Exit 3 with stale-resume-plan has ok=false and needs --fresh; completed-with-junk requires reading the refusal list. Answer exit 4 with --approve, correct usage on 2, and investigate the error on 1.">COPY THE PROMPT</button></div><div class="prompt-card"><span class="prompt-label">RUN THIS XERJ COMMAND</span>@@@ -307,10 -309,10 +309,10 @@@<p>You answer it by re-running the same command with <code class="inline">--approve proceed</code>, <code class="inline">--approve fast</code> or <code class="inline">--approve cancel</code>. <code class="inline">fast</code> also applies <code class="inline">--no-semantic --no-graph</code>.</p><p>A person at a terminal is prompted instead, but only when the question can actually be seen: stdin a terminal, stderr a terminal, and the progress surface on. A piped or agent-driven run is never prompted, and <code class="inline">--quiet</code> silences the prompt as well. Every un-prompted run behaves identically — the JSON request goes to stdout, which <code class="inline">--quiet</code> does not silence, and the process exits 4. The payload's <code class="inline">prompt_not_offered_because</code> names which of the three conditions was missing.</p><p><code class="inline">xerj autoindex</code> never waits on stdin for a question it did not print.</p>- <h2>Exit 1 and exit 2 are narrower than "any error"</h2>- <p>The common shorthand is that 1 means any error. The binary is more specific, and the difference matters to a retry policy.</p>+ <h2>Read the error before retrying exit 1 or 2</h2>- <p>Exit 1 covers runtime failures. Exit 2 identifies a usage error. The diagnostic tells you what needs to change.</p>++ <p>Exit 1 covers runtime failures. Exit 2 identifies a usage error. The diagnostic identifies the required change.</p><p><code class="inline">2 usage</code> is a bad command line. Nothing ran, and a retry of the same command will fail the same way.</p>- <p><code class="inline">1</code> is an endpoint or journal failure, a refused corpus removal, or a refused unsafe state transition. The last two are refusals by design, not crashes: removing an indexed file is refused before any remote mutation, because its documents are already live and nothing on that path deletes them.</p>+ <p><code class="inline">1</code> covers runtime failures, including node or journal errors, refused unsafe operations, unavailable parser workers, and missing-data verification failures. A refusal need not mean a crash. Follow its recovery message; an unchanged retry does not correct missing or incompatible state.</p><p>So a 1 is not always something to retry. Read the error line first.</p><h3>Two exit-1 endings that name themselves</h3><p>On the <code class="inline">--no-graph</code> path, a run whose node answered its writes with HTTP 429 for the whole 600 seconds a bulk waits ends with a reason of its own instead of <code class="inline">aborted</code>:</p>diff --cc landing/answers/autoindex-exit-codes.mdindex 53d54f8f9,7c8d12d02..184b8f7ee--- a/landing/answers/autoindex-exit-codes.md+++ b/landing/answers/autoindex-exit-codes.md@@@ -12,7 -12,7 +12,7 @@@ source: "content/answers/autoindex-exit**Key number:** The decision gate that produces exit 4 defaults to 10 minutes of estimated work (`DEFAULT_MAX_MINUTES`). (as of 2026-10-19; source: [engine/crates/xerj-autoindex/src/gate.rs](https://github.com/xerj-org/xerj/blob/main/engine/crates/xerj-autoindex/src/gate.rs))- **TL;DR** — Exit 3 is a success. `xerj autoindex` exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded `--max-minutes` and nothing was indexed. Exit 2 is a usage error, and exit 1 is an endpoint or journal failure. Only 4 is a question.-**TL;DR** — Read the terminal reason as well as the exit code. Exit 3 with `completed-with-junk` is success; `stale-resume-plan` has `ok=false` because new files were not indexed and needs a `--fresh` rebuild. `xerj autoindex` exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded `--max-minutes` and nothing was indexed. Exit 2 is a usage error, and exit 1 is a runtime failure. Only 4 is a question.++**TL;DR** — Read the terminal reason as well as the exit code. Exit 3 with `completed-with-junk` is success. With `stale-resume-plan`, `ok=false` means new files were not indexed. Rebuild with `--fresh` to include them. `xerj autoindex` exits 0 when the run completed, and 3 when it completed and recorded junk. Exit 4 means the estimate exceeded `--max-minutes` and nothing was indexed. Exit 2 is a usage error, and exit 1 is a runtime failure. Only 4 is a question.## Agent prompt@@@ -116,9 -125,9 +125,9 @@@ A person at a terminal is prompted inst`xerj autoindex` never waits on stdin for a question it did not print.- ## Exit 1 and exit 2 are narrower than "any error"+ ## Read the error before retrying exit 1 or 2- The common shorthand is that 1 means any error. The binary is more specific, and the difference matters to a retry policy.-Exit 1 covers runtime failures. Exit 2 identifies a usage error. The diagnostic tells you what needs to change.++Exit 1 covers runtime failures. Exit 2 identifies a usage error. The diagnostic identifies the required change.`2 usage` is a bad command line. Nothing ran, and a retry of the same command will fail the same way.