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
Prepare stale-plan completion diagnostics with consistent recovery guidance
xerj-org794774bf9620
diff --cc AGENTS.mdindex 8a297b041,8a297b041..5fcd2ddf6--- a/AGENTS.md+++ b/AGENTS.md@@@ -127,7 -127,7 +127,9 @@@ usage · `1` any error at all (read thneeds a decision (gate above; answer with `--approve`, never a retry). Exit `3`also carries `reason=catalog-alias-sweep-failed`: the corpus **is** indexed andthe journal committed, and only the catalog's duplicate-alias cleanup could not--run — read `reason`, not the bare code, to tell the two apart. Exit `3` can++run — read `reason`, not the bare code, to tell the two apart. Exit `3` with `reason=stale-resume-plan` instead carries `ok=false`: files++added after the plan was frozen were not indexed. Read `skipped_appeared` and++rerun with `--fresh` to rebuild that plan. Exit `3` canalso mean a **whole dataset is missing**: if the server answers HTTP 400 to onedataset's mapping, that dataset's files are recorded as junk with the server'sreason, every other dataset is indexed, and `xerj-done` carriesdiff --cc content/answers/autoindex-exit-codes.mdindex b635a7053,b635a7053..fd63f9f54--- a/content/answers/autoindex-exit-codes.md+++ b/content/answers/autoindex-exit-codes.md@@@ -7,13 -7,13 +7,13 @@@ cluster: "Operations: exit codesquestion: "What does indexer exit code 3 mean?"intent: "troubleshooting"published: "2026-08-22"--updated: "2026-10-24"++updated: "2026-10-28"author: "XERJ documentation team"reviewer: "XERJ engineering team"schema_type: "TechArticle"structured_data: [faq]--agent_prompt: "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."--answer: "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."++agent_prompt: "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."++answer: "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."key_fact: "The decision gate that produces exit 4 defaults to 10 minutes of estimated work (`DEFAULT_MAX_MINUTES`)."key_fact_source: "engine/crates/xerj-autoindex/src/gate.rs"key_fact_date: "2026-10-19"@@@ -22,7 -22,7 +22,7 @@@ commands- cmd: "xerj autoindex --help"note: "Print the exit-code contract from the binary you actually installed."- cmd: "xerj autoindex ./corpus --url http://127.0.0.1:9200 --prefix ax --state-dir ./state --progress plain"-- note: "A normal run. Exit 0 means nothing was refused; exit 3 means it finished and refused something."++ note: "A normal run. Inspect the terminal reason and refusal counters; exit 3 may also mean a stale resume plan."- cmd: "xerj autoindex ./corpus --url http://127.0.0.1:9200 --prefix ax --state-dir ./state --max-minutes 1 --progress plain"note: "Set a low budget so the estimate can trip the decision gate and exit 4."- cmd: "xerj autoindex ./corpus --url http://127.0.0.1:9200 --prefix ax --state-dir ./state --approve proceed --progress plain"@@@ -38,7 -38,7 +38,7 @@@ links_out- "autoindex-dataset-refused-by-server"- "autoindex-server-back-pressure-429"evidence:-- - claim: "EXIT CODES: 0 complete (also: gate answered with --approve cancel); 3 completed-with-junk (junk recorded, never fatal) — SUCCESS: the index is searchable, and the summary on stdout opens with a line starting `ok:` that says so (xerj-done carries ok=true). Treat 0 and 3 alike as a finished run. This includes a dataset whose mapping the server REFUSED: its files are recorded as junk with the server's reason, the xerj-done line carries datasets_refused / files_refused, and every other dataset is indexed; 4 NEEDS A DECISION — the estimate exceeded --max-minutes and nothing was indexed, a JSON decision request is on stdout; 2 usage; 1 endpoint/journal failure, a refused corpus removal, or a refused unsafe state transition."++ - claim: "Exit 3 completed-with-junk is success. The separate stale-resume-plan outcome carries ok=false and requires --fresh to include new files. Dataset refusal counters name missing datasets even when ok=true. Exit 1 reports real errors; usage is 2 and a decision request is 4."source: "engine/crates/xerj-autoindex/src/cli.rs:771"- claim: "Exit 4 is a code of its own; 1 is the catch-all for real failures, and the decision request is answered by re-running the same command with --approve proceed, fast or cancel."source: "engine/crates/xerj-autoindex/src/cli.rs:771"@@@ -54,13 -54,13 +54,13 @@@source: "engine/crates/xerj-autoindex/src/lib.rs:277"faq:- q: "What does indexer exit code 3 mean?"-- a: "It means the run completed and recorded junk. `xerj autoindex --help` states it as `3 completed-with-junk (junk recorded, never fatal) — SUCCESS` and says to treat 0 and 3 alike as a finished run. Treat it as a success with a refusal list to read. Do not rerun it as a failure."++ a: "It means the run completed and recorded junk. `xerj autoindex --help` states it as `3 completed-with-junk (junk recorded, never fatal) — SUCCESS` and says to treat 0 and 3 alike as a finished run. For completed-with-junk, read the refusal list. For reason=stale-resume-plan, ok=false means new files were not indexed; rebuild with --fresh."- q: "The indexer exited 3 (or 4). Did it fail?"-- a: "3 did not fail. 4 did not fail either, and it did not index anything: it is a decision request waiting for `--approve`. Only 1 and 2 are failures."++ a: "3 requires checking its reason: a stale resume plan leaves new files unindexed. 4 did not index anything: it is a decision request waiting for `--approve`. Only 1 and 2 are failures."- q: "Why did folder indexing stop and ask me to approve?"a: "The measured phase-A estimate for the indexing phase was longer than `--max-minutes` (default 10). With no `--approve` or `--yes`, nothing is indexed, a JSON decision request goes to stdout and the process exits 4."- q: "How do I tell a failed index from a completed one with junk files?"-- a: "Read the exit code, not the log volume. 0 and 3 are both finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the `xerj-done` line carries `datasets_refused` and `files_refused`. 1 is an endpoint or journal failure and nothing about it is a junk report."++ a: "Read the exit code and terminal reason. A stale-resume-plan outcome is incomplete and needs --fresh; otherwise 0 and 3 are finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the `xerj-done` line carries `datasets_refused` and `files_refused`. 1 is an endpoint or journal failure and nothing about it is a junk report."- q: "Is exit 1 the code for any error?"a: "No, and that shorthand is wrong. `--help` scopes 1 to an endpoint or journal failure, a refused corpus removal, or a refused unsafe state transition. A bad command line is 2. On the `--no-graph` path, an exit 1 whose terminal line reads `reason=server-backpressure` means the node rejected every write for the whole 600 s a bulk waits; the line carries `ops_applied` and `ops_remaining`."- q: "Does exit 0 always mean the folder was indexed?"@@@ -68,19 -68,19 +68,19 @@@- 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 an endpoint or journal failure. Only 4 is a question.## The codes, as the binary states them--The list below is quoted from `xerj autoindex --help` on the installed binary. Run that command yourself before you write a branch on any of these numbers.++The table summarizes `xerj autoindex --help`; the terminal reason distinguishes partial outcomes. Run that command yourself before you write a branch on any of these numbers.| Exit | Name in `--help` | What it means for the corpus || --- | --- | --- || 0 | complete | The run finished and refused nothing. A gate answered with `--approve cancel` also exits 0. |--| 3 | completed-with-junk | SUCCESS. The run finished. At least one file was refused and recorded. Treat it the same as exit 0: the index is searchable. This includes a whole dataset whose mapping the server refused. |++| 3 | completed with a reported outcome | Read `reason`: completed-with-junk is success with refusals to inspect; stale-resume-plan means new files were skipped and needs `--fresh`. Refused datasets can leave an entire dataset missing. || 4 | NEEDS A DECISION | The estimate exceeded `--max-minutes`. Nothing was indexed. A JSON decision request is on stdout. || 2 | usage | The command line was wrong. Nothing ran. || 1 | endpoint/journal failure | The node or the resume journal failed, a corpus removal was refused, or an unsafe state transition was refused. |@@@ -89,7 -89,7 +89,7 @@@ Read the table in that order rather tha## Exit 3 is a finished run--`3 completed-with-junk (junk recorded, never fatal) — SUCCESS` is the phrase in the help text, and it says to treat 0 and 3 alike as a finished run. Exit 3 is success. Do not rerun it as a failure.++`3 completed-with-junk (junk recorded, never fatal) — SUCCESS` is the phrase in the help text, and it says to treat 0 and 3 alike as a finished run. That describes completed-with-junk. For `reason=stale-resume-plan`, the run instead reports `ok=false` and leads with `not ok:`: new files were left out of its frozen plan.A folder of real files almost always contains something XERJ will not parse. An unknown binary, an image, a file above `--max-file-gb`. Those files are recorded in the catalog with a reason, and the rest of the folder is indexed and queryable.@@@ -97,6 -97,6 +97,15 @@@ An agent that treats a non-zero exit aThe companion check is the refusal list, not the exit code: read `autoindex-catalog` and match each refused path to its reason. The [skipped-files page](/answers/why-autoindex-skipped-files) covers that query.++## Exit 3 with a stale resume plan needs a rebuild++++With `reason=stale-resume-plan`, `skipped_appeared` counts files that arrived++after the saved plan was frozen. The terminal event carries `ok=false`, names++the skipped paths, and gives a `--fresh` recovery command. Existing indexed++files remain searchable. Re-run the same indexing command with `--fresh` to++rebuild the plan and include the new files; an unchanged resume still uses the++old plan. This outcome is not a junk classification.++## Exit 3 can also mean a whole dataset is missingThe server can refuse the mapping of one dataset with an HTTP 400. That used to abort the entire run with exit 1 and index nothing. It now costs that one dataset: its files are recorded as junk with the server's reason, every other dataset is indexed, and the run exits 3.diff --cc engine/crates/xerj-autoindex/src/cli.rsindex b7aa4a9fa,be55c560f..f224b37e5--- a/engine/crates/xerj-autoindex/src/cli.rs+++ b/engine/crates/xerj-autoindex/src/cli.rs@@@ -795,8 -796,11 +796,11 @@@ pub fn help_text_with(feedback: bool) -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resume plan was frozen. They are not counted as junk.\n\\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20`skipped_appeared` is the count; the summary names the\n\\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20first few paths and says to re-run with --fresh to\n\- \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rebuild the plan in place and include them. Read `reason`\n\- \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20to tell this apart from completed-with-junk;\n\- \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rebuild the plan in place and include them. This is the one\n\- \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20exit 3 that is not a complete index: the xerj-done line\n\++ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rebuild the plan in place and include them. For this\n\++ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20exit 3, the xerj-done line\n\+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20carries ok=false and the summary opens with `not ok:`,\n\+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20because the files it skipped are not searchable. Read\n\+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20`reason` to tell this apart from completed-with-junk;\n\\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or files-removed — a graph-path rerun deleted documents,\n\\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20catalog rows and edges for files that left the folder.\n\\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20The index matches the folder; the next unchanged rerun is\n\diff --cc engine/crates/xerj-autoindex/src/failure_resume_http_tests.rsindex a7a5cd7ba,0bca3de6d..80f205221--- a/engine/crates/xerj-autoindex/src/failure_resume_http_tests.rs+++ b/engine/crates/xerj-autoindex/src/failure_resume_http_tests.rs@@@ -1618,6 -1618,6 +1618,7 @@@ fn a_resume_whose_plan_predates_new_fil"{done}");assert!(!done.contains("reason=completed-with-junk"), "{done}");++ assert!(done.contains("ok=false"), "{done}");{let locked = endpoint.state.lock().unwrap();let live: Vec<&str> = locked@@@ -1659,7 -1659,9 +1660,9 @@@.unwrap_or_else(|| panic!("no JSON done event:\n{stream}"));assert_eq!(done["exit"], 3, "{done}");assert_eq!(done["reason"], "stale-resume-plan", "{done}");- assert_eq!(done["ok"], true, "{done}");- // #2411: exit 3 is not an error, but `ok` is not "the run finished" — it is- // "the index covers this folder", and these files are not in it.++ // #2411: a completed run over a stale plan does not include these files.++ // Other partial outcomes have their own fields; ok is not a coverage proof.+ assert_eq!(done["ok"], false, "{done}");assert_eq!(done["skipped_appeared"], 2, "{done}");assert_eq!(done["skipped_appeared_files"],diff --cc engine/crates/xerj-autoindex/src/lib.rsindex 4d1395292,1cf89e66b..3ef02c024--- a/engine/crates/xerj-autoindex/src/lib.rs+++ b/engine/crates/xerj-autoindex/src/lib.rs@@@ -12728,8 -12736,14 +12736,12 @@@ fn run_index_report_innerif !appeared_json.is_empty() {pr.set_done_json(appeared_json.clone());}- // #2411: `ok` means this run's index covers the folder, not merely that- // nothing crashed. A stale resume plan leaves files that are on disk out of- // the index, so the corpus is incomplete even though exit 3 is not an error- // — `ok=true` told a reader the folder was indexed when four of its five- // files were not.++ // #2411: new files absent from a frozen plan need a rebuild. Do not mark++ // that stale-plan outcome ok. Other exit-3 outcomes still use their existing++ // flags (for example datasets_refused); ok alone is not full coverage.+ let complete = pdf_worker_unavailable.is_none() && skipped_appeared == 0;pr.finish(- pdf_worker_unavailable.is_none(),+ complete,code,// A worker that cannot start wins the `reason`: exit 3 would call a// missing PDF family success (#2336). A stale plan is next, becausediff --cc landing/answers/autoindex-exit-codes.htmlindex dd5a34d59,dd5a34d59..c88cb8a2e--- a/landing/answers/autoindex-exit-codes.html+++ b/landing/answers/autoindex-exit-codes.html@@@ -79,7 -79,7 +79,7 @@@"image": "https://xerj.org/og/xerj-card.png","inLanguage": "en","datePublished": "2026-08-22",-- "dateModified": "2026-10-24",++ "dateModified": "2026-10-28","author": {"@type": "Organization","name": "XERJ documentation team",@@@ -116,7 -116,7 +116,7 @@@"name": "What does indexer exit code 3 mean?","acceptedAnswer": {"@type": "Answer",-- "text": "It means the run completed and recorded junk. xerj autoindex --help states it as 3 completed-with-junk (junk recorded, never fatal) — SUCCESS and says to treat 0 and 3 alike as a finished run. Treat it as a success with a refusal list to read. Do not rerun it as a failure."++ "text": "It means the run completed and recorded junk. xerj autoindex --help states it as 3 completed-with-junk (junk recorded, never fatal) — SUCCESS and says to treat 0 and 3 alike as a finished run. For completed-with-junk, read the refusal list. For reason=stale-resume-plan, ok=false means new files were not indexed; rebuild with --fresh."}},{@@@ -124,7 -124,7 +124,7 @@@"name": "The indexer exited 3 (or 4). Did it fail?","acceptedAnswer": {"@type": "Answer",-- "text": "3 did not fail. 4 did not fail either, and it did not index anything: it is a decision request waiting for --approve. Only 1 and 2 are failures."++ "text": "3 requires checking its reason: a stale resume plan leaves new files unindexed. 4 did not index anything: it is a decision request waiting for --approve. Only 1 and 2 are failures."}},{@@@ -140,7 -140,7 +140,7 @@@"name": "How do I tell a failed index from a completed one with junk files?","acceptedAnswer": {"@type": "Answer",-- "text": "Read the exit code, not the log volume. 0 and 3 are both finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the xerj-done line carries datasets_refused and files_refused. 1 is an endpoint or journal failure and nothing about it is a junk report."++ "text": "Read the exit code and terminal reason. A stale-resume-plan outcome is incomplete and needs --fresh; otherwise 0 and 3 are finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the xerj-done line carries datasets_refused and files_refused. 1 is an endpoint or journal failure and nothing about it is a junk report."}},{@@@ -172,7 -172,7 +172,7 @@@"name": "Which codes should an agent retry?","acceptedAnswer": {"@type": "Answer",-- "text": "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."++ "text": "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."}}]@@@ -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 an endpoint or journal 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>@@@ -254,7 -254,7 +254,7 @@@<span class="prompt-label">RUN THIS XERJ COMMAND</span><code>xerj autoindex ./corpus --url http://127.0.0.1:9200 --prefix ax --state-dir ./state --progress plain</code><button type="button" class="prompt-copy" data-copy="xerj autoindex ./corpus --url http://127.0.0.1:9200 --prefix ax --state-dir ./state --progress plain">COPY COMMAND</button>-- <span class="hero-proof">A normal run. Exit 0 means nothing was refused; exit 3 means it finished and refused something.</span>++ <span class="hero-proof">A normal run. Inspect the terminal reason and refusal counters; exit 3 may also mean a stale resume plan.</span></div><div class="prompt-card"><span class="prompt-label">RUN THIS XERJ COMMAND</span>@@@ -275,12 -275,12 +275,12 @@@<span class="hero-proof">Read the journal when the process is gone and you have no terminal line.</span></div><h2>The codes, as the binary states them</h2>-- <p>The list below is quoted from <code class="inline">xerj autoindex --help</code> on the installed binary. Run that command yourself before you write a branch on any of these numbers.</p>++ <p>The table summarizes <code class="inline">xerj autoindex --help</code>; the terminal reason distinguishes partial outcomes. Run that command yourself before you write a branch on any of these numbers.</p><table><thead><tr><th>Exit</th><th>Name in <code class="inline">--help</code></th><th>What it means for the corpus</th></tr></thead><tbody><tr><td>0</td><td>complete</td><td>The run finished and refused nothing. A gate answered with <code class="inline">--approve cancel</code> also exits 0.</td></tr>-- <tr><td>3</td><td>completed-with-junk</td><td>SUCCESS. The run finished. At least one file was refused and recorded. Treat it the same as exit 0: the index is searchable. This includes a whole dataset whose mapping the server refused.</td></tr>++ <tr><td>3</td><td>completed with a reported outcome</td><td>Read <code class="inline">reason</code>: completed-with-junk is success with refusals to inspect; stale-resume-plan means new files were skipped and needs <code class="inline">--fresh</code>. Refused datasets can leave an entire dataset missing.</td></tr><tr><td>4</td><td>NEEDS A DECISION</td><td>The estimate exceeded <code class="inline">--max-minutes</code>. Nothing was indexed. A JSON decision request is on stdout.</td></tr><tr><td>2</td><td>usage</td><td>The command line was wrong. Nothing ran.</td></tr><tr><td>1</td><td>endpoint/journal failure</td><td>The node or the resume journal failed, a corpus removal was refused, or an unsafe state transition was refused.</td></tr>@@@ -288,10 -288,10 +288,12 @@@</table><p>Read the table in that order rather than in numeric order. It is the order the help text uses, and it is the order of decreasing goodness.</p><h2>Exit 3 is a finished run</h2>-- <p><code class="inline">3 completed-with-junk (junk recorded, never fatal) — SUCCESS</code> is the phrase in the help text, and it says to treat 0 and 3 alike as a finished run. Exit 3 is success. Do not rerun it as a failure.</p>++ <p><code class="inline">3 completed-with-junk (junk recorded, never fatal) — SUCCESS</code> is the phrase in the help text, and it says to treat 0 and 3 alike as a finished run. That describes completed-with-junk. For <code class="inline">reason=stale-resume-plan</code>, the run instead reports <code class="inline">ok=false</code> and leads with <code class="inline">not ok:</code>: new files were left out of its frozen plan.</p><p>A folder of real files almost always contains something XERJ will not parse. An unknown binary, an image, a file above <code class="inline">--max-file-gb</code>. Those files are recorded in the catalog with a reason, and the rest of the folder is indexed and queryable.</p><p>An agent that treats a non-zero exit as a failure will therefore throw away a perfectly good index. Branch on the specific value.</p><p>The companion check is the refusal list, not the exit code: read <code class="inline">autoindex-catalog</code> and match each refused path to its reason. The <a href="/answers/why-autoindex-skipped-files">skipped-files page</a> covers that query.</p>++ <h2>Exit 3 with a stale resume plan needs a rebuild</h2>++ <p>With <code class="inline">reason=stale-resume-plan</code>, <code class="inline">skipped_appeared</code> counts files that arrived after the saved plan was frozen. The terminal event carries <code class="inline">ok=false</code>, names the skipped paths, and gives a <code class="inline">--fresh</code> recovery command. Existing indexed files remain searchable. Re-run the same indexing command with <code class="inline">--fresh</code> to rebuild the plan and include the new files; an unchanged resume still uses the old plan. This outcome is not a junk classification.</p><h2>Exit 3 can also mean a whole dataset is missing</h2><p>The server can refuse the mapping of one dataset with an HTTP 400. That used to abort the entire run with exit 1 and index nothing. It now costs that one dataset: its files are recorded as junk with the server's reason, every other dataset is indexed, and the run exits 3.</p><p>The terminal line says so, and only when it happened:</p>@@@ -351,13 -351,13 +353,13 @@@ error: prepared bulk contained 1 reject<p>The other codes were not forced, so there is no capture for them here and no timing. If you want the codes on your own build, <code class="inline">xerj autoindex --help</code> prints them in one screen.</p><h2>FAQ</h2><h3>What does indexer exit code 3 mean?</h3>-- <p>It means the run completed and recorded junk. <code class="inline">xerj autoindex --help</code> states it as <code class="inline">3 completed-with-junk (junk recorded, never fatal) — SUCCESS</code> and says to treat 0 and 3 alike as a finished run. Treat it as a success with a refusal list to read. Do not rerun it as a failure.</p>++ <p>It means the run completed and recorded junk. <code class="inline">xerj autoindex --help</code> states it as <code class="inline">3 completed-with-junk (junk recorded, never fatal) — SUCCESS</code> and says to treat 0 and 3 alike as a finished run. For completed-with-junk, read the refusal list. For reason=stale-resume-plan, ok=false means new files were not indexed; rebuild with --fresh.</p><h3>The indexer exited 3 (or 4). Did it fail?</h3>-- <p>3 did not fail. 4 did not fail either, and it did not index anything: it is a decision request waiting for <code class="inline">--approve</code>. Only 1 and 2 are failures.</p>++ <p>3 requires checking its reason: a stale resume plan leaves new files unindexed. 4 did not index anything: it is a decision request waiting for <code class="inline">--approve</code>. Only 1 and 2 are failures.</p><h3>Why did folder indexing stop and ask me to approve?</h3><p>The measured phase-A estimate for the indexing phase was longer than <code class="inline">--max-minutes</code> (default 10). With no <code class="inline">--approve</code> or <code class="inline">--yes</code>, nothing is indexed, a JSON decision request goes to stdout and the process exits 4.</p><h3>How do I tell a failed index from a completed one with junk files?</h3>-- <p>Read the exit code, not the log volume. 0 and 3 are both finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the <code class="inline">xerj-done</code> line carries <code class="inline">datasets_refused</code> and <code class="inline">files_refused</code>. 1 is an endpoint or journal failure and nothing about it is a junk report.</p>++ <p>Read the exit code and terminal reason. A stale-resume-plan outcome is incomplete and needs --fresh; otherwise 0 and 3 are finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the <code class="inline">xerj-done</code> line carries <code class="inline">datasets_refused</code> and <code class="inline">files_refused</code>. 1 is an endpoint or journal failure and nothing about it is a junk report.</p><h3>Is exit 1 the code for any error?</h3><p>No, and that shorthand is wrong. <code class="inline">--help</code> scopes 1 to an endpoint or journal failure, a refused corpus removal, or a refused unsafe state transition. A bad command line is 2. On the <code class="inline">--no-graph</code> path, an exit 1 whose terminal line reads <code class="inline">reason=server-backpressure</code> means the node rejected every write for the whole 600 s a bulk waits; the line carries <code class="inline">ops_applied</code> and <code class="inline">ops_remaining</code>.</p><h3>Does exit 0 always mean the folder was indexed?</h3>@@@ -365,10 -365,10 +367,10 @@@<h3>Why did my run print no terminal line at all?</h3><p>Either <code class="inline">--quiet</code> or <code class="inline">--progress none</code> 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.</p><h3>Which codes should an agent retry?</h3>-- <p>Retry nothing on 0 or 3. Re-run with <code class="inline">--approve</code> 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 <code class="inline">reason=server-backpressure</code>, once the node accepts writes again: it resumes with the operations that remain.</p>++ <p>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 <code class="inline">--approve</code> 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 <code class="inline">reason=server-backpressure</code>, once the node accepts writes again: it resumes with the operations that remain.</p><h2>Evidence</h2><ul>-- <li>EXIT CODES: 0 complete (also: gate answered with --approve cancel); 3 completed-with-junk (junk recorded, never fatal) — SUCCESS: the index is searchable, and the summary on stdout opens with a line starting <code class="inline">ok:</code> that says so (xerj-done carries ok=true). Treat 0 and 3 alike as a finished run. This includes a dataset whose mapping the server REFUSED: its files are recorded as junk with the server's reason, the xerj-done line carries datasets_refused / files_refused, and every other dataset is indexed; 4 NEEDS A DECISION — the estimate exceeded --max-minutes and nothing was indexed, a JSON decision request is on stdout; 2 usage; 1 endpoint/journal failure, a refused corpus removal, or a refused unsafe state transition. — <code>engine/crates/xerj-autoindex/src/cli.rs:771</code></li>++ <li>Exit 3 completed-with-junk is success. The separate stale-resume-plan outcome carries ok=false and requires --fresh to include new files. Dataset refusal counters name missing datasets even when ok=true. Exit 1 reports real errors; usage is 2 and a decision request is 4. — <code>engine/crates/xerj-autoindex/src/cli.rs:771</code></li><li>Exit 4 is a code of its own; 1 is the catch-all for real failures, and the decision request is answered by re-running the same command with --approve proceed, fast or cancel. — <code>engine/crates/xerj-autoindex/src/cli.rs:771</code></li><li>A forced mapping refusal ended xerj-done ok=true exit=3 reason=completed-with-junk wall=0.7s files=1 records=1 generation=1 datasets_refused=1 files_refused=2, with the other dataset indexed. — <code>benchmarks/autoindex-resilience/refusal-e2e.run1.stderr.txt</code></li><li>Before issue #955 was fixed, a 48,533-file --no-graph run applied every operation and then ended xerj-done ok=false exit=1 reason=aborted wall=10336.0s, because the catalog went out as one bulk request of 51,129 actions and the engine's max_actions_per_bulk is 50,000. — <code>benchmarks/autoindex-resilience/before-955.stderr.txt</code></li>diff --cc landing/answers/autoindex-exit-codes.mdindex 53d54f8f9,53d54f8f9..f1de58fd0--- a/landing/answers/autoindex-exit-codes.md+++ b/landing/answers/autoindex-exit-codes.md@@@ -2,22 -2,22 +2,22 @@@---title: "What do the xerj autoindex exit codes mean?"canonical: "https://xerj.org/answers/autoindex-exit-codes"--updated: "2026-10-24"++updated: "2026-10-28"source: "content/answers/autoindex-exit-codes.md"---# The indexer exited 3 (or 4). Did it fail?--**Short answer** (updated 2026-10-24): 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.++**Short answer** (updated 2026-10-28): 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.**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 an endpoint or journal failure. Only 4 is a question.## Agent prompt```text--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.++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.```## Commands@@@ -32,7 -32,7 +32,7 @@@ xerj autoindex --hel### Command 2--Note: A normal run. Exit 0 means nothing was refused; exit 3 means it finished and refused something.++Note: A normal run. Inspect the terminal reason and refusal counters; exit 3 may also mean a stale resume plan.```shxerj autoindex ./corpus --url http://127.0.0.1:9200 --prefix ax --state-dir ./state --progress plain@@@ -64,12 -64,12 +64,12 @@@ xerj autoindex status --url http://127.## The codes, as the binary states them--The list below is quoted from `xerj autoindex --help` on the installed binary. Run that command yourself before you write a branch on any of these numbers.++The table summarizes `xerj autoindex --help`; the terminal reason distinguishes partial outcomes. Run that command yourself before you write a branch on any of these numbers.| Exit | Name in `--help` | What it means for the corpus || --- | --- | --- || 0 | complete | The run finished and refused nothing. A gate answered with `--approve cancel` also exits 0. |--| 3 | completed-with-junk | SUCCESS. The run finished. At least one file was refused and recorded. Treat it the same as exit 0: the index is searchable. This includes a whole dataset whose mapping the server refused. |++| 3 | completed with a reported outcome | Read `reason`: completed-with-junk is success with refusals to inspect; stale-resume-plan means new files were skipped and needs `--fresh`. Refused datasets can leave an entire dataset missing. || 4 | NEEDS A DECISION | The estimate exceeded `--max-minutes`. Nothing was indexed. A JSON decision request is on stdout. || 2 | usage | The command line was wrong. Nothing ran. || 1 | endpoint/journal failure | The node or the resume journal failed, a corpus removal was refused, or an unsafe state transition was refused. |@@@ -78,7 -78,7 +78,7 @@@ Read the table in that order rather tha## Exit 3 is a finished run--`3 completed-with-junk (junk recorded, never fatal) — SUCCESS` is the phrase in the help text, and it says to treat 0 and 3 alike as a finished run. Exit 3 is success. Do not rerun it as a failure.++`3 completed-with-junk (junk recorded, never fatal) — SUCCESS` is the phrase in the help text, and it says to treat 0 and 3 alike as a finished run. That describes completed-with-junk. For `reason=stale-resume-plan`, the run instead reports `ok=false` and leads with `not ok:`: new files were left out of its frozen plan.A folder of real files almost always contains something XERJ will not parse. An unknown binary, an image, a file above `--max-file-gb`. Those files are recorded in the catalog with a reason, and the rest of the folder is indexed and queryable.@@@ -86,6 -86,6 +86,15 @@@ An agent that treats a non-zero exit aThe companion check is the refusal list, not the exit code: read `autoindex-catalog` and match each refused path to its reason. The [skipped-files page](/answers/why-autoindex-skipped-files) covers that query.++## Exit 3 with a stale resume plan needs a rebuild++++With `reason=stale-resume-plan`, `skipped_appeared` counts files that arrived++after the saved plan was frozen. The terminal event carries `ok=false`, names++the skipped paths, and gives a `--fresh` recovery command. Existing indexed++files remain searchable. Re-run the same indexing command with `--fresh` to++rebuild the plan and include the new files; an unchanged resume still uses the++old plan. This outcome is not a junk classification.++## Exit 3 can also mean a whole dataset is missingThe server can refuse the mapping of one dataset with an HTTP 400. That used to abort the entire run with exit 1 and index nothing. It now costs that one dataset: its files are recorded as junk with the server's reason, every other dataset is indexed, and the run exits 3.@@@ -190,11 -190,11 +199,11 @@@ The other codes were not forced, so the### What does indexer exit code 3 mean?--It means the run completed and recorded junk. `xerj autoindex --help` states it as `3 completed-with-junk (junk recorded, never fatal) — SUCCESS` and says to treat 0 and 3 alike as a finished run. Treat it as a success with a refusal list to read. Do not rerun it as a failure.++It means the run completed and recorded junk. `xerj autoindex --help` states it as `3 completed-with-junk (junk recorded, never fatal) — SUCCESS` and says to treat 0 and 3 alike as a finished run. For completed-with-junk, read the refusal list. For reason=stale-resume-plan, ok=false means new files were not indexed; rebuild with --fresh.### The indexer exited 3 (or 4). Did it fail?--3 did not fail. 4 did not fail either, and it did not index anything: it is a decision request waiting for `--approve`. Only 1 and 2 are failures.++3 requires checking its reason: a stale resume plan leaves new files unindexed. 4 did not index anything: it is a decision request waiting for `--approve`. Only 1 and 2 are failures.### Why did folder indexing stop and ask me to approve?@@@ -202,7 -202,7 +211,7 @@@ The measured phase-A estimate for the i### How do I tell a failed index from a completed one with junk files?--Read the exit code, not the log volume. 0 and 3 are both finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the `xerj-done` line carries `datasets_refused` and `files_refused`. 1 is an endpoint or journal failure and nothing about it is a junk report.++Read the exit code and terminal reason. A stale-resume-plan outcome is incomplete and needs --fresh; otherwise 0 and 3 are finished runs; 3 additionally refused at least one file, or a whole dataset whose mapping the server answered HTTP 400 to, in which case the `xerj-done` line carries `datasets_refused` and `files_refused`. 1 is an endpoint or journal failure and nothing about it is a junk report.### Is exit 1 the code for any error?@@@ -218,11 -218,11 +227,11 @@@ Either `--quiet` or `--progress none` w### Which codes should an agent retry?--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.++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.## Evidence--- EXIT CODES: 0 complete (also: gate answered with --approve cancel); 3 completed-with-junk (junk recorded, never fatal) — SUCCESS: the index is searchable, and the summary on stdout opens with a line starting `ok:` that says so (xerj-done carries ok=true). Treat 0 and 3 alike as a finished run. This includes a dataset whose mapping the server REFUSED: its files are recorded as junk with the server's reason, the xerj-done line carries datasets_refused / files_refused, and every other dataset is indexed; 4 NEEDS A DECISION — the estimate exceeded --max-minutes and nothing was indexed, a JSON decision request is on stdout; 2 usage; 1 endpoint/journal failure, a refused corpus removal, or a refused unsafe state transition. — `engine/crates/xerj-autoindex/src/cli.rs:771`++- Exit 3 completed-with-junk is success. The separate stale-resume-plan outcome carries ok=false and requires --fresh to include new files. Dataset refusal counters name missing datasets even when ok=true. Exit 1 reports real errors; usage is 2 and a decision request is 4. — `engine/crates/xerj-autoindex/src/cli.rs:771`- Exit 4 is a code of its own; 1 is the catch-all for real failures, and the decision request is answered by re-running the same command with --approve proceed, fast or cancel. — `engine/crates/xerj-autoindex/src/cli.rs:771`- A forced mapping refusal ended xerj-done ok=true exit=3 reason=completed-with-junk wall=0.7s files=1 records=1 generation=1 datasets_refused=1 files_refused=2, with the other dataset indexed. — `benchmarks/autoindex-resilience/refusal-e2e.run1.stderr.txt`- Before issue #955 was fixed, a 48,533-file --no-graph run applied every operation and then ended xerj-done ok=false exit=1 reason=aborted wall=10336.0s, because the catalog went out as one bulk request of 51,129 actions and the engine's max_actions_per_bulk is 50,000. — `benchmarks/autoindex-resilience/before-955.stderr.txt`diff --cc landing/answers/index.htmlindex 418848942,418848942..2af85eeaa--- a/landing/answers/index.html+++ b/landing/answers/index.html@@@ -77,7 -77,7 +77,7 @@@"url": "https://xerj.org/answers/","image": "https://xerj.org/og/xerj-card.png","inLanguage": "en",-- "dateModified": "2026-10-24",++ "dateModified": "2026-10-28","isPartOf": {"@id": "https://xerj.org/#website"},diff --cc landing/llms-full.txtindex 2ada39e0b,2ada39e0b..c2ec369ae--- a/landing/llms-full.txt+++ b/landing/llms-full.txt@@@ -533,6 -533,6 +533,11 @@@ character class. The class reading stay`.h`. The ignore summary names a route-like class, a pruned `[…]` directory,and each skipped code file with its rule.++With `reason=stale-resume-plan`, exit 3 carries `ok=false`: files added after++the resume plan was frozen were not indexed. `skipped_appeared` counts them;++re-run with `--fresh` to rebuild the plan in place. Existing indexed files stay++searchable. This is separate from the completed-with-junk outcome below.++Exit codes: 0 complete (also: the gate was answered `--approve cancel`) ·3 completed-with-junk (junk recorded, never fatal — this is SUCCESS, do not reportit as a failure; it INCLUDES a whole dataset whose mapping the server refused with andiff --cc landing/llms.txtindex c91d220f5,c91d220f5..25db35c37--- a/landing/llms.txt+++ b/landing/llms.txt@@@ -36,7 -36,7 +36,7 @@@ Then, from an unknown folder to an answ- [Air-gapped deployment](https://xerj.org/docs/recipes/air-gapped-deployment): release staging, offline neural model files, the loopback/auth boundary, and the Console's font fetches- [Zero-config autoindex recipe](https://xerj.org/docs/recipes/zero-config-autoindex): the flagship walkthrough plus the recorded verification runs — ground-truth scoring on a mixed-format corpus, throughput, flat client memory, `kill -9` resume convergence- [Estimate a run before you start it](https://xerj.org/answers/estimate-autoindex-time-before-running.md): indexing can occupy a person's laptop for minutes and they cannot see your tool output — estimate with `--dry-run`, tell them, ask if it is big, relay progress, report the real time. Also: the `--max-minutes` / `--approve` gate and which releases have it--- [What the exit codes mean](https://xerj.org/answers/autoindex-exit-codes.md): `0` complete · **`3` completed-with-junk is SUCCESS** · `2` usage · `1` any error at all, so read the `error:` line first · `4` needs a decision, answered with `--approve`, never a retry++- [What the exit codes mean](https://xerj.org/answers/autoindex-exit-codes.md): `0` complete · **`3` completed-with-junk is SUCCESS** (but `reason=stale-resume-plan`, `ok=false` means new files were not indexed; rebuild with `--fresh`) · `2` usage · `1` any error at all, so read the `error:` line first · `4` needs a decision, answered with `--approve`, never a retry- [A dataset was REFUSED by the server](https://xerj.org/answers/autoindex-dataset-refused-by-server.md): one dataset whose mapping the server answers HTTP 400 to costs THAT dataset, not the run — its files are recorded as junk with the server's reason, every other dataset is indexed, exit is `3`, and `xerj-done` carries `datasets_refused=N files_refused=M` (present only when it happened). **Read `datasets_refused` before you call a corpus searchable**, and do not retry: the refusal is part of the committed generation, so rebuild under a new `--prefix` and `--state-dir` after fixing the cause. A 401/403/404/408/429/5xx is NOT a refusal and still exits `1`- [The server pushed back (HTTP 429)](https://xerj.org/answers/autoindex-server-back-pressure-429.md): a 429 on a bulk, whole or per item, is the node's memory circuit breaker shedding load for a moment — the run lowers concurrency, re-sends ONLY the rejected items after a backoff, and continues; the stream says `server is shedding load … re-offering` (not a hang) and the terminal line carries `bulk_retries=N` when it happened. It exits `1` only after 600 s of re-sends the node never takes, with an error line beginning `the server kept rejecting`; rerun the same command to resume- [Index a mail export](https://xerj.org/answers/search-gmail-takeout-mbox-locally.md): a Google Takeout / Thunderbird / Apple Mail mbox is detected by CONTENT and streamed one message at a time (multi-GB is the normal case); every message becomes a record with `email_from`/`email_to`/`email_subject`/`email_date`/`email_message_id`/`email_thread_id`/`email_labels` — filter senders on `email_from_address` (the bare address; `email_from` is a keyword holding the whole `Display Name <addr>` string, so a `term` on it misses any mail with a display name), every attachment its own record (PDFs per page) with `attachment_name`, and `In-Reply-To`/`References` become `replies_to` edges in the brain. Unzip the Takeout download first — autoindex never opens archives, it records them as junk with the exact command ([why](https://xerj.org/answers/autoindex-says-extract-the-archive-first.md)). PST/OST/Maildir: no extractor, export to mbox. Layout rules verified on a synthetic tree only — say so. Measured limit to relay BEFORE indexing a multi-GB export: since [#1002](https://github.com/xerj-org/xerj/pull/1002) (v1.0.0-rc.76) a 1 GB synthetic mailbox completes under the node's default 16 GiB cap (407.7 s, every needle and edge verified) but still peaks at 21,405.3 MiB — 1.3× that cap, so a real 16 GiB machine can swap or OOM — and reads degrade while the memory breaker is engaged (verify p95 5.54 s vs 7.5 ms at base). A 300 MB mailbox fits an 8 GiB cap (7,963.6 MiB). [#1002](https://github.com/xerj-org/xerj/pull/1002) closed [#948](https://github.com/xerj-org/xerj/issues/948)