Skip to content

armgit / xerj

Public Imported from GitHub
0

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.

fix(cli): keep the indent of wrapped help lines (#1626)

xerj-orgef9bf75a2682
diff --git a/engine/crates/xerj-autoindex/src/cli.rs b/engine/crates/xerj-autoindex/src/cli.rs
index f89da08c2..ac9e91bb3 100644
--- a/engine/crates/xerj-autoindex/src/cli.rs
+++ b/engine/crates/xerj-autoindex/src/cli.rs
@@ -223,9 +223,9 @@ pub const MAX_POLL_INTERVAL_SECS: u64 = 86_400;
const FRESH_HELP: &str =
"ignore an existing resume journal and restart, rebuild the plan in place\n\
- (ids stay idempotent); it never resets destination records,\n\
- and is refused on a durable corpus generation — see\n\
- RESUME POLICY";
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(ids stay idempotent); it never resets destination records,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20and is refused on a durable corpus generation — see\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20RESUME POLICY";
const RESUME_POLICY_HELP: &str =
"generated --no-graph journals reconcile add, change, delete, rename, and no-op runs; \
a --no-graph state directory written before the generation format must be rebuilt into a new \
@@ -249,392 +249,392 @@ pub fn help_text_with(feedback: bool) -> String {
\n\
{feedback_block}\
USAGE:\n\
- xerj autoindex <folder> [OPTIONS] discover + index a folder\n\
- xerj autoindex s3://<bucket>/<prefix> [OPTIONS]\n\
- discover + index objects in a bucket\n\
- (r2:// too; see OBJECT STORAGE)\n\
- xerj autoindex map [OPTIONS] print the discovered data map\n\
- xerj autoindex status [OPTIONS] resume-journal + index progress view\n\
- xerj autoindex s3://bucket/prefix --watch [OPTIONS]\n\
- poll object storage and emit a change feed\n\
+ \x20\x20\x20\x20xerj autoindex <folder> [OPTIONS] discover + index a folder\n\
+ \x20\x20\x20\x20xerj autoindex s3://<bucket>/<prefix> [OPTIONS]\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discover + index objects in a bucket\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(r2:// too; see OBJECT STORAGE)\n\
+ \x20\x20\x20\x20xerj autoindex map [OPTIONS] print the discovered data map\n\
+ \x20\x20\x20\x20xerj autoindex status [OPTIONS] resume-journal + index progress view\n\
+ \x20\x20\x20\x20xerj autoindex s3://bucket/prefix --watch [OPTIONS]\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20poll object storage and emit a change feed\n\
\n\
OPTIONS:\n\
- --url <U> ES-compat endpoint (default http://localhost:9200)\n\
- --api-key <K> Authorization header (or env XERJ_API_KEY)\n\
- --workers <N> workers for BOTH phases — content hashing/sniffing and\n\
- indexing (default: every core, reduced if the memory\n\
- safe zone cannot pay for that many bulk buffers; a\n\
- value you pass is honoured and only warned about;\n\
- valid range 1..=1024)\n\
- --pdf-workers <N> concurrent PDF parser processes (default min(cores,4); max 4,\n\
- the default reduced further on a machine with little\n\
- free memory)\n\
- --pdf-timeout-secs <N> per-PDF parser timeout (default 120; max 3600)\n\
- --bulk-mb <N> bulk cut size in MB (default 8)\n\
- --bulk-timeout-secs <N>\n\
- bulk HTTP request timeout in seconds (default 300;\n\
- valid range 1..=3600)\n\
- --prefix <P> index prefix (default ax)\n\
- --state-dir <PATH> resume journal location (default ~/.xerj/autoindex/<hash>/);\n\
- for an s3:// source this is also where the local\n\
- object mirror lives, so point it at a disk with room\n\
- --endpoint-url <URL> S3-compatible endpoint for an s3:// source (MinIO,\n\
- Ceph, R2, localstack). Defaults to\n\
- $AWS_ENDPOINT_URL_S3, then $AWS_ENDPOINT_URL.\n\
- Refused for a folder rather than ignored\n\
- --snapshot-max-gb <N> logical payload cap for sealed source+prepared records\n\
- bytes (default 64); excludes filesystem/manifest overhead\n\
- --fresh {fresh_help}\n\
- --follow-symlinks follow symlinks (loop-safe); off by default.\n\
- A link is judged by what it RESOLVES to: a\n\
- target outside the folder is refused, and one\n\
- inside a hidden directory is skipped like any\n\
- dotfile, whatever the link itself is called\n\
- --follow-symlinks-outside-root\n\
- also follow links that resolve OUTSIDE the\n\
- folder. Requires --follow-symlinks. Off by\n\
- default; pointing at a folder is not consent\n\
- to index whatever it links to. The hidden-file\n\
- rule still applies to the target, judged from\n\
- where it diverges from your folder — so a\n\
- dotted directory the two paths SHARE does not\n\
- refuse anything, because your folder is\n\
- already inside it\n\
- --stub <GLOB> index matching files as ONE existence-only name\n\
- card (title + provenance); contents are never\n\
- opened. Repeatable. A pattern without '/'\n\
- matches file names anywhere ('*.bvh'); with '/'\n\
- it matches the root-relative path\n\
- ('unity/**/*.csv'). '**' crosses directories\n\
- --no-ignore index everything: no .gitignore, no .xerjignore, no\n\
- .git/info/exclude, no built-in defaults. Hidden files\n\
- (.env, .git/, .ssh) stay skipped either way — that is\n\
- not an ignore rule, it is what keeps secrets out.\n\
- --no-default-ignores keep the ignore files, drop only the built-in list\n\
- ({defaults})\n\
- --max-file-gb <N> skip+record oversized non-streamable files, cap in whole\n\
- GB (default 2). Use --max-file-mb/--max-file-bytes for a\n\
- smaller cap; the three are mutually exclusive\n\
- --max-file-mb <N> same cap expressed in whole MB (e.g. 10 for a source\n\
- watcher); mutually exclusive with --max-file-gb/-bytes\n\
- --max-file-bytes <N> same cap expressed in whole bytes; mutually exclusive\n\
- with --max-file-gb/--max-file-mb\n\
- --sample <N> records sampled per file for inference (default 500)\n\
- --no-semantic skip semantic_text on body fields (pure BM25+keyword)\n\
- --code-analyzer <A> standard (default) or code: `code` declares the built-in\n\
- identifier-aware analyzer (splits snake_case/camelCase,\n\
- keeps the original token) on NEWLY created datasets\n\
- holding source code; existing indexes keep theirs.\n\
- Measured +0.11 file-localization acc@5 (#1198); costs\n\
- ~15% index size and ~2.4x text-analysis time\n\
- --brain <NAME> second-brain name; relationship edges land in\n\
- .xerj-memory-<NAME>-edges (default: folder name slug)\n\
- --no-graph skip relationship detection (wikilinks, local links,\n\
- section order, directory chains) — no edges are written\n\
- --watch index once, then stay resident and reindex what changes.\n\
- Needs --no-graph: the graph route refuses an ADDED file\n\
- (exit 3, skipped until --fresh) and ABORTS on a deletion\n\
- (exit 1, and every later re-run aborts too). It does\n\
- reindex a MODIFIED file. One OS watch per indexed\n\
- directory, no polling; respects the same ignore rules as\n\
- a re-run. docs/LIVE_REINDEXING.md has the measurements.\n\
- --debounce <MS> --watch quiet period before a pass (default 400, max\n\
- 60000). One editor save is several filesystem events.\n\
- --max-minutes <N> stop and ask before indexing if phase A's MEASURED estimate\n\
- is longer than this (default 10; 0 disables the gate;\n\
- max 10080). See ESTIMATE + DECISION GATE below.\n\
- --approve <ID> answer a decision request: proceed | fast | cancel.\n\
- `fast` also applies --no-semantic --no-graph. `narrower`\n\
- is NOT accepted here — it means re-running against a\n\
- subdirectory, which this flag cannot do.\n\
- --yes, -y alias for --approve proceed\n\
- --dry-run walk+sniff+infer, print the plan, index nothing\n\
- --label <FILE> label each document at ingest through POST /_decide\n\
- (#1062): the question-set file's noul/choice questions\n\
- are rendered against each record's fields and the vote\n\
- stamped on as label + label_p (and label_<id> +\n\
- label_<id>_p per question). p is the RAW decide\n\
- confidence - calibration is #1063. One /_decide call\n\
- per noul (per option, for a choice) per document.\n\
- --json machine-readable RESULT on stdout (map: raw catalog docs).\n\
- Orthogonal to --progress, which owns stderr.\n\
- --progress <MODE> liveness on stderr: auto|plain|json|none (default auto).\n\
- auto = live redrawn line when stderr is a terminal,\n\
- otherwise one parseable line per interval. plain and\n\
- json force that shape everywhere (CI, pipes, agents).\n\
- --progress-interval <SECS>\n\
- progress cadence, 1..=3600 (default 1 on a terminal,\n\
- 5 otherwise). This is the guaranteed upper bound on\n\
- silence between phases.\n\
- --quiet errors only (implies --progress none). The decision gate\n\
- NEVER prompts under this flag, even at a terminal — the\n\
- question would be silenced with everything else. It emits\n\
- the JSON decision request on stdout and exits 4 instead,\n\
- exactly like an agent-driven run. See ESTIMATE + DECISION\n\
- GATE.\n\
- --dataset <SLUG> (map) show a single dataset\n\
- --offset <N> (map) skip the first N dataset detail sections\n\
- --limit <N> (map) how many dataset detail sections to print\n\
- (default: all of them when there are few, otherwise\n\
- the first page — the summary table always lists every\n\
- dataset)\n\
- --disable-feedback do not print the feedback invitation above; honoured in\n\
- any position, including after --help (env\n\
- XERJ_DISABLE_FEEDBACK=true)\n\
- --help, -h this help\n\
+ \x20\x20\x20\x20--url <U> ES-compat endpoint (default http://localhost:9200)\n\
+ \x20\x20\x20\x20--api-key <K> Authorization header (or env XERJ_API_KEY)\n\
+ \x20\x20\x20\x20--workers <N> workers for BOTH phases — content hashing/sniffing and\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20indexing (default: every core, reduced if the memory\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20safe zone cannot pay for that many bulk buffers; a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20value you pass is honoured and only warned about;\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20valid range 1..=1024)\n\
+ \x20\x20\x20\x20--pdf-workers <N> concurrent PDF parser processes (default min(cores,4); max 4,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the default reduced further on a machine with little\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20free memory)\n\
+ \x20\x20\x20\x20--pdf-timeout-secs <N> per-PDF parser timeout (default 120; max 3600)\n\
+ \x20\x20\x20\x20--bulk-mb <N> bulk cut size in MB (default 8)\n\
+ \x20\x20\x20\x20--bulk-timeout-secs <N>\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bulk HTTP request timeout in seconds (default 300;\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20valid range 1..=3600)\n\
+ \x20\x20\x20\x20--prefix <P> index prefix (default ax)\n\
+ \x20\x20\x20\x20--state-dir <PATH> resume journal location (default ~/.xerj/autoindex/<hash>/);\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for an s3:// source this is also where the local\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20object mirror lives, so point it at a disk with room\n\
+ \x20\x20\x20\x20--endpoint-url <URL> S3-compatible endpoint for an s3:// source (MinIO,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Ceph, R2, localstack). Defaults to\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20$AWS_ENDPOINT_URL_S3, then $AWS_ENDPOINT_URL.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Refused for a folder rather than ignored\n\
+ \x20\x20\x20\x20--snapshot-max-gb <N> logical payload cap for sealed source+prepared records\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20bytes (default 64); excludes filesystem/manifest overhead\n\
+ \x20\x20\x20\x20--fresh {fresh_help}\n\
+ \x20\x20\x20\x20--follow-symlinks follow symlinks (loop-safe); off by default.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A link is judged by what it RESOLVES to: a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20target outside the folder is refused, and one\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20inside a hidden directory is skipped like any\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20dotfile, whatever the link itself is called\n\
+ \x20\x20\x20\x20--follow-symlinks-outside-root\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20also follow links that resolve OUTSIDE the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20folder. Requires --follow-symlinks. Off by\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20default; pointing at a folder is not consent\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20to index whatever it links to. The hidden-file\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rule still applies to the target, judged from\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20where it diverges from your folder — so a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20dotted directory the two paths SHARE does not\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20refuse anything, because your folder is\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20already inside it\n\
+ \x20\x20\x20\x20--stub <GLOB> index matching files as ONE existence-only name\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20card (title + provenance); contents are never\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20opened. Repeatable. A pattern without '/'\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20matches file names anywhere ('*.bvh'); with '/'\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20it matches the root-relative path\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20('unity/**/*.csv'). '**' crosses directories\n\
+ \x20\x20\x20\x20--no-ignore index everything: no .gitignore, no .xerjignore, no\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.git/info/exclude, no built-in defaults. Hidden files\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(.env, .git/, .ssh) stay skipped either way — that is\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20not an ignore rule, it is what keeps secrets out.\n\
+ \x20\x20\x20\x20--no-default-ignores keep the ignore files, drop only the built-in list\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20({defaults})\n\
+ \x20\x20\x20\x20--max-file-gb <N> skip+record oversized non-streamable files, cap in whole\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20GB (default 2). Use --max-file-mb/--max-file-bytes for a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20smaller cap; the three are mutually exclusive\n\
+ \x20\x20\x20\x20--max-file-mb <N> same cap expressed in whole MB (e.g. 10 for a source\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20watcher); mutually exclusive with --max-file-gb/-bytes\n\
+ \x20\x20\x20\x20--max-file-bytes <N> same cap expressed in whole bytes; mutually exclusive\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20with --max-file-gb/--max-file-mb\n\
+ \x20\x20\x20\x20--sample <N> records sampled per file for inference (default 500)\n\
+ \x20\x20\x20\x20--no-semantic skip semantic_text on body fields (pure BM25+keyword)\n\
+ \x20\x20\x20\x20--code-analyzer <A> standard (default) or code: `code` declares the built-in\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20identifier-aware analyzer (splits snake_case/camelCase,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20keeps the original token) on NEWLY created datasets\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20holding source code; existing indexes keep theirs.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Measured +0.11 file-localization acc@5 (#1198); costs\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20~15% index size and ~2.4x text-analysis time\n\
+ \x20\x20\x20\x20--brain <NAME> second-brain name; relationship edges land in\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.xerj-memory-<NAME>-edges (default: folder name slug)\n\
+ \x20\x20\x20\x20--no-graph skip relationship detection (wikilinks, local links,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20section order, directory chains) — no edges are written\n\
+ \x20\x20\x20\x20--watch index once, then stay resident and reindex what changes.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Needs --no-graph: the graph route refuses an ADDED file\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(exit 3, skipped until --fresh) and ABORTS on a deletion\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(exit 1, and every later re-run aborts too). It does\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20reindex a MODIFIED file. One OS watch per indexed\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20directory, no polling; respects the same ignore rules as\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20a re-run. docs/LIVE_REINDEXING.md has the measurements.\n\
+ \x20\x20\x20\x20--debounce <MS> --watch quiet period before a pass (default 400, max\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2060000). One editor save is several filesystem events.\n\
+ \x20\x20\x20\x20--max-minutes <N> stop and ask before indexing if phase A's MEASURED estimate\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20is longer than this (default 10; 0 disables the gate;\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20max 10080). See ESTIMATE + DECISION GATE below.\n\
+ \x20\x20\x20\x20--approve <ID> answer a decision request: proceed | fast | cancel.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20`fast` also applies --no-semantic --no-graph. `narrower`\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20is NOT accepted here — it means re-running against a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20subdirectory, which this flag cannot do.\n\
+ \x20\x20\x20\x20--yes, -y alias for --approve proceed\n\
+ \x20\x20\x20\x20--dry-run walk+sniff+infer, print the plan, index nothing\n\
+ \x20\x20\x20\x20--label <FILE> label each document at ingest through POST /_decide\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(#1062): the question-set file's noul/choice questions\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20are rendered against each record's fields and the vote\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stamped on as label + label_p (and label_<id> +\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20label_<id>_p per question). p is the RAW decide\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20confidence - calibration is #1063. One /_decide call\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20per noul (per option, for a choice) per document.\n\
+ \x20\x20\x20\x20--json machine-readable RESULT on stdout (map: raw catalog docs).\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Orthogonal to --progress, which owns stderr.\n\
+ \x20\x20\x20\x20--progress <MODE> liveness on stderr: auto|plain|json|none (default auto).\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auto = live redrawn line when stderr is a terminal,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20otherwise one parseable line per interval. plain and\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20json force that shape everywhere (CI, pipes, agents).\n\
+ \x20\x20\x20\x20--progress-interval <SECS>\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress cadence, 1..=3600 (default 1 on a terminal,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x205 otherwise). This is the guaranteed upper bound on\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20silence between phases.\n\
+ \x20\x20\x20\x20--quiet errors only (implies --progress none). The decision gate\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20NEVER prompts under this flag, even at a terminal — the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20question would be silenced with everything else. It emits\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the JSON decision request on stdout and exits 4 instead,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20exactly like an agent-driven run. See ESTIMATE + DECISION\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20GATE.\n\
+ \x20\x20\x20\x20--dataset <SLUG> (map) show a single dataset\n\
+ \x20\x20\x20\x20--offset <N> (map) skip the first N dataset detail sections\n\
+ \x20\x20\x20\x20--limit <N> (map) how many dataset detail sections to print\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(default: all of them when there are few, otherwise\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the first page — the summary table always lists every\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20dataset)\n\
+ \x20\x20\x20\x20--disable-feedback do not print the feedback invitation above; honoured in\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20any position, including after --help (env\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20XERJ_DISABLE_FEEDBACK=true)\n\
+ \x20\x20\x20\x20--help, -h this help\n\
\n\
IGNORE RULES:\n\
- The fastest file is the one that is never read, so junk is dropped during\n\
- the walk, not after it. Honoured, highest precedence first:\n\
- .xerjignore same syntax as .gitignore, XERJ-only. Use it to exclude\n\
- something git tracks, or to re-include (!pattern) something\n\
- git ignores. Outranks .gitignore at any depth.\n\
- .gitignore including nested ones and negation; the closest file wins.\n\
- .git/info/exclude per-checkout excludes, including nested checkouts.\n\
- built-in {defaults}\n\
- Both git-owned kinds stop at a repository boundary, exactly as git does:\n\
- a .gitignore above a nested checkout does not judge files inside it, so\n\
- vendored and submoduled trees keep their own rules. .xerjignore and the\n\
- built-in list are XERJ's, not git's, and apply throughout the folder.\n\
- Your global gitignore (core.excludesFile) is NOT read: a machine-wide\n\
- preference should not silently decide what is in your index.\n\
- A directory the rules reject is never descended, so nothing inside it is\n\
- stat-ed, hashed or sent. Every run prints what was dropped and by which\n\
- rule; --dry-run additionally counts the non-hidden files inside each\n\
- pruned directory (bounded — past the budget the count is reported as\n\
- `at least N`, and xerj-done carries\n\
- ignored_files_in_pruned_dirs_exact=false to say so).\n\
- The folder you name is never rejected: if it is itself ignored, it is\n\
- indexed anyway and the run says which rule it would have matched.\n\
+ \x20\x20\x20\x20The fastest file is the one that is never read, so junk is dropped during\n\
+ \x20\x20\x20\x20the walk, not after it. Honoured, highest precedence first:\n\
+ \x20\x20\x20\x20\x20\x20.xerjignore same syntax as .gitignore, XERJ-only. Use it to exclude\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20something git tracks, or to re-include (!pattern) something\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20git ignores. Outranks .gitignore at any depth.\n\
+ \x20\x20\x20\x20\x20\x20.gitignore including nested ones and negation; the closest file wins.\n\
+ \x20\x20\x20\x20\x20\x20.git/info/exclude per-checkout excludes, including nested checkouts.\n\
+ \x20\x20\x20\x20\x20\x20built-in {defaults}\n\
+ \x20\x20\x20\x20Both git-owned kinds stop at a repository boundary, exactly as git does:\n\
+ \x20\x20\x20\x20a .gitignore above a nested checkout does not judge files inside it, so\n\
+ \x20\x20\x20\x20vendored and submoduled trees keep their own rules. .xerjignore and the\n\
+ \x20\x20\x20\x20built-in list are XERJ's, not git's, and apply throughout the folder.\n\
+ \x20\x20\x20\x20Your global gitignore (core.excludesFile) is NOT read: a machine-wide\n\
+ \x20\x20\x20\x20preference should not silently decide what is in your index.\n\
+ \x20\x20\x20\x20A directory the rules reject is never descended, so nothing inside it is\n\
+ \x20\x20\x20\x20stat-ed, hashed or sent. Every run prints what was dropped and by which\n\
+ \x20\x20\x20\x20rule; --dry-run additionally counts the non-hidden files inside each\n\
+ \x20\x20\x20\x20pruned directory (bounded — past the budget the count is reported as\n\
+ \x20\x20\x20\x20`at least N`, and xerj-done carries\n\
+ \x20\x20\x20\x20ignored_files_in_pruned_dirs_exact=false to say so).\n\
+ \x20\x20\x20\x20The folder you name is never rejected: if it is itself ignored, it is\n\
+ \x20\x20\x20\x20indexed anyway and the run says which rule it would have matched.\n\
\n\
OBJECT STORAGE:\n\
- `xerj autoindex s3://bucket/prefix` indexes objects instead of files.\n\
- `r2://bucket/prefix` is the same thing and needs --endpoint-url with the\n\
- account host. Credentials come from AWS_ACCESS_KEY_ID /\n\
- AWS_SECRET_ACCESS_KEY (+ AWS_SESSION_TOKEN) in the ENVIRONMENT ONLY — no\n\
- profile files, no instance metadata, no SSO — and never from the URL.\n\
- A non-empty prefix is treated as a FOLDER: s3://b/docs lists docs/ and not\n\
- docs-old/. The effective prefix is printed at the start of the run.\n\
- CHANGE DETECTION is the object's ETag plus its size, recorded in\n\
- <state-dir>/object-source.json. The ETag is treated as an opaque token, so\n\
- a multipart upload's `-N` form is fine and nothing is compared to an MD5.\n\
- A re-run downloads only what changed; an unchanged prefix downloads nothing.\n\
- THE BYTES ARE MIRRORED to <state-dir>/object-cache/<bucket-prefix>/ and the\n\
- ordinary walk runs over that mirror, so extraction sees exactly the bytes it\n\
- sees for a folder. Budget local disk for the prefix you index. The INDEX\n\
- still lives on the XERJ node at --url; nothing is written to the bucket.\n\
- Objects whose keys cannot be a safe local path are skipped and named:\n\
- `..`, an empty component, a backslash, a control character, a trailing dot\n\
- or space, a Windows reserved name, and any dot-prefixed component (so a\n\
- bucket's .env and .git/ stay out of the index, exactly as in a folder).\n\
- COST: one run costs ceil(objects/1000) class-A LIST requests plus one\n\
- class-B GET per changed object, and never writes. Counts are BILLED WIRE\n\
- ATTEMPTS: a request the store throttled and the client retried counts once\n\
- per attempt, because that is what the store bills. Every run prints what it\n\
- spent and what running it hourly or every 5 minutes would spend against a\n\
- 1,000,000/month class-A allowance — read that line before adding a cron.\n\
- A run that fails mid-transfer records the objects it already fetched, so a\n\
- re-run pays for the rest only — but it re-lists, so the LIST cost recurs.\n\
+ \x20\x20\x20\x20`xerj autoindex s3://bucket/prefix` indexes objects instead of files.\n\
+ \x20\x20\x20\x20`r2://bucket/prefix` is the same thing and needs --endpoint-url with the\n\
+ \x20\x20\x20\x20account host. Credentials come from AWS_ACCESS_KEY_ID /\n\
+ \x20\x20\x20\x20AWS_SECRET_ACCESS_KEY (+ AWS_SESSION_TOKEN) in the ENVIRONMENT ONLY — no\n\
+ \x20\x20\x20\x20profile files, no instance metadata, no SSO — and never from the URL.\n\
+ \x20\x20\x20\x20A non-empty prefix is treated as a FOLDER: s3://b/docs lists docs/ and not\n\
+ \x20\x20\x20\x20docs-old/. The effective prefix is printed at the start of the run.\n\
+ \x20\x20\x20\x20CHANGE DETECTION is the object's ETag plus its size, recorded in\n\
+ \x20\x20\x20\x20<state-dir>/object-source.json. The ETag is treated as an opaque token, so\n\
+ \x20\x20\x20\x20a multipart upload's `-N` form is fine and nothing is compared to an MD5.\n\
+ \x20\x20\x20\x20A re-run downloads only what changed; an unchanged prefix downloads nothing.\n\
+ \x20\x20\x20\x20THE BYTES ARE MIRRORED to <state-dir>/object-cache/<bucket-prefix>/ and the\n\
+ \x20\x20\x20\x20ordinary walk runs over that mirror, so extraction sees exactly the bytes it\n\
+ \x20\x20\x20\x20sees for a folder. Budget local disk for the prefix you index. The INDEX\n\
+ \x20\x20\x20\x20still lives on the XERJ node at --url; nothing is written to the bucket.\n\
+ \x20\x20\x20\x20Objects whose keys cannot be a safe local path are skipped and named:\n\
+ \x20\x20\x20\x20`..`, an empty component, a backslash, a control character, a trailing dot\n\
+ \x20\x20\x20\x20or space, a Windows reserved name, and any dot-prefixed component (so a\n\
+ \x20\x20\x20\x20bucket's .env and .git/ stay out of the index, exactly as in a folder).\n\
+ \x20\x20\x20\x20COST: one run costs ceil(objects/1000) class-A LIST requests plus one\n\
+ \x20\x20\x20\x20class-B GET per changed object, and never writes. Counts are BILLED WIRE\n\
+ \x20\x20\x20\x20ATTEMPTS: a request the store throttled and the client retried counts once\n\
+ \x20\x20\x20\x20per attempt, because that is what the store bills. Every run prints what it\n\
+ \x20\x20\x20\x20spent and what running it hourly or every 5 minutes would spend against a\n\
+ \x20\x20\x20\x201,000,000/month class-A allowance — read that line before adding a cron.\n\
+ \x20\x20\x20\x20A run that fails mid-transfer records the objects it already fetched, so a\n\
+ \x20\x20\x20\x20re-run pays for the rest only — but it re-lists, so the LIST cost recurs.\n\
\n\
PDF EXTRACTION:\n\
- Each PDF uses a fresh process. Limits: 512 MiB input, 32 MiB worker output,\n\
- 100,000 pages, and 1.5 GiB address space on Unix. This is crash/resource\n\
- isolation, not a security sandbox; non-Unix platforms have no OS memory cap.\n\
- Image-only pages need OCR. Page parse failures reject the whole PDF instead\n\
- of silently creating a partial index. XERJ_PDF_WORKER_BIN is a trusted,\n\
- developer-only executable override.\n\
- On Linux, fresh runs attempt to retain each validated PDF extraction in\n\
- bounded anonymous storage under --state-dir. Live admission-time checks\n\
- attempt to preserve disk and descriptor headroom; refused artifacts are\n\
- parsed again in phase B and reported under pdf_extraction_reuse. Other\n\
- platforms currently disable this optimization. Frozen-plan resumes skip\n\
- phase A and parse unfinished PDFs once.\n\
- --pdf-workers bounds both phase-A parser processes and phase-B replay\n\
- materialization; --workers does not widen that PDF memory gate.\n\
+ \x20\x20\x20\x20Each PDF uses a fresh process. Limits: 512 MiB input, 32 MiB worker output,\n\
+ \x20\x20\x20\x20100,000 pages, and 1.5 GiB address space on Unix. This is crash/resource\n\
+ \x20\x20\x20\x20isolation, not a security sandbox; non-Unix platforms have no OS memory cap.\n\
+ \x20\x20\x20\x20Image-only pages need OCR. Page parse failures reject the whole PDF instead\n\
+ \x20\x20\x20\x20of silently creating a partial index. XERJ_PDF_WORKER_BIN is a trusted,\n\
+ \x20\x20\x20\x20developer-only executable override.\n\
+ \x20\x20\x20\x20On Linux, fresh runs attempt to retain each validated PDF extraction in\n\
+ \x20\x20\x20\x20bounded anonymous storage under --state-dir. Live admission-time checks\n\
+ \x20\x20\x20\x20attempt to preserve disk and descriptor headroom; refused artifacts are\n\
+ \x20\x20\x20\x20parsed again in phase B and reported under pdf_extraction_reuse. Other\n\
+ \x20\x20\x20\x20platforms currently disable this optimization. Frozen-plan resumes skip\n\
+ \x20\x20\x20\x20phase A and parse unfinished PDFs once.\n\
+ \x20\x20\x20\x20--pdf-workers bounds both phase-A parser processes and phase-B replay\n\
+ \x20\x20\x20\x20materialization; --workers does not widen that PDF memory gate.\n\
\n\
INCREMENTAL RECONCILIATION:\n\
- Generated journals with --no-graph reconcile added, removed, moved, and changed\n\
- files. Legacy journals and graph-enabled generations remain fail-closed. Each\n\
- changed generation currently copies and prepares the full corpus (O(N)); the\n\
- latest full snapshot remains retained, and cleanup re-reads protected artifacts\n\
- to verify them. --snapshot-max-gb limits logical staged payload bytes before each\n\
- write; it is not a physical disk-space or peak-allocation guarantee.\n\
+ \x20\x20\x20\x20Generated journals with --no-graph reconcile added, removed, moved, and changed\n\
+ \x20\x20\x20\x20files. Legacy journals and graph-enabled generations remain fail-closed. Each\n\
+ \x20\x20\x20\x20changed generation currently copies and prepares the full corpus (O(N)); the\n\
+ \x20\x20\x20\x20latest full snapshot remains retained, and cleanup re-reads protected artifacts\n\
+ \x20\x20\x20\x20to verify them. --snapshot-max-gb limits logical staged payload bytes before each\n\
+ \x20\x20\x20\x20write; it is not a physical disk-space or peak-allocation guarantee.\n\
\n\
EMBEDDINGS:\n\
- autoindex sends semantic_text to the running server; it does not choose the\n\
- server's embedding backend. The default is lexical (not neural). For the\n\
- experimental ONNX backend, start xerj with `--embed-mode onnx-experimental\n\
- --onnx-model MODEL.onnx --onnx-tokenizer tokenizer.json`, then run autoindex.\n\
- ONNX runs only for fields inferred as semantic_text (normally long body text;\n\
- short/structured datasets may infer none). Use --dry-run or `autoindex map` to\n\
- confirm a semantic field before attributing an indexing result to embeddings.\n\
+ \x20\x20\x20\x20autoindex sends semantic_text to the running server; it does not choose the\n\
+ \x20\x20\x20\x20server's embedding backend. The default is lexical (not neural). For the\n\
+ \x20\x20\x20\x20experimental ONNX backend, start xerj with `--embed-mode onnx-experimental\n\
+ \x20\x20\x20\x20--onnx-model MODEL.onnx --onnx-tokenizer tokenizer.json`, then run autoindex.\n\
+ \x20\x20\x20\x20ONNX runs only for fields inferred as semantic_text (normally long body text;\n\
+ \x20\x20\x20\x20short/structured datasets may infer none). Use --dry-run or `autoindex map` to\n\
+ \x20\x20\x20\x20confirm a semantic field before attributing an indexing result to embeddings.\n\
\n\
PROGRESS STREAM:\n\
- stdout is the RESULT, stderr is PROGRESS — pipe them separately.\n\
- Every run that reaches an exit — success OR error — ends with one\n\
- terminal line, in every progress mode EXCEPT `none` (which --quiet\n\
- selects), so an outcome never has to be guessed from silence:\n\
- xerj-done ok=true exit=3 reason=completed-with-junk wall=57.6s …\n\
- The terminal line also carries code coverage — code_files=N\n\
- code_files_indexed=M code_files_junked=K — so a corpus whose\n\
- source files were ALL dropped cannot print the same line as a\n\
- healthy one. code_files>0 with code_files_indexed=0 is always a\n\
- defect, and the run says so in words as well.\n\
- --quiet/--progress none prints no progress and NO terminal line\n\
- (only a fatal `error:` line, if any) — poll `autoindex status\n\
- --state-dir <dir>` or read the exit code instead of waiting for\n\
- output that never comes.\n\
- (A run killed by a signal cannot print one either; a missing\n\
- terminal line after the process is gone means it died, not that it\n\
- finished.)\n\
- --progress plain writes TWO lines per tick, in one write:\n\
- xerj-bar [######################--] 93.4% | index | 8082/8083 items | eta 7s\n\
- xerj-progress phase=index basis=bytes pct=93.4 items=8082/8083 eta_s=7.2 …\n\
- `xerj-bar` is the DISPLAY line — self-contained, meant to be shown\n\
- to a person verbatim by whatever is relaying the run. It is spaced\n\
- at most one per 15s, plus one per phase change and never two closer\n\
- than 2s, so it does not flood a transcript. Short phases therefore\n\
- draw fewer bars than transitions — read the machine line for those.\n\
- `xerj-progress` is the MACHINE line and keeps\n\
- the --progress-interval cadence; parse that one. --progress json\n\
- stays one object per line and carries the same rendered string in\n\
- a `bar` field on the same schedule: a string on the ticks that owe\n\
- a bar, null in between.\n\
- Every record is identified by its leading token, and that is\n\
- enforced: paths and other outside text are stripped of control\n\
- characters and bounded before they reach any line, so a crafted\n\
- filename cannot forge a record or repaint your terminal.\n\
- `pct`/`eta_s` are the literal word `unknown` (JSON null) whenever they\n\
- cannot be computed honestly, never a filler number — and the drawn\n\
- bar obeys the same rule: `[????…]` when there is no denominator,\n\
- and a full bar only at a real 100%.\n\
- PHASES, in order. Every long step is a phase of its own, so a line\n\
- that still says `scan` at 100% means scan — not indexing:\n\
- default (graph) path: walk, hash, scan, prepare, graph, index,\n\
- graph-corpus, finalize-refresh, finalize-count,\n\
- finalize-correlate, finalize-histogram, finalize-catalog\n\
- --no-graph path: walk, hash, scan, prepare (install mappings),\n\
- snapshot (seal + extract, bytes), index (sealed bulk bytes, the\n\
- in-flight file named), finalize-catalog, finalize-refresh (one\n\
- refresh per dataset), finalize-verify (read-backs batched\n\
- into per-index digest windows, one search per window). A\n\
- resumed run starts at `replay` and its `index` phase\n\
- counts only the operations still to apply.\n\
+ \x20\x20\x20\x20stdout is the RESULT, stderr is PROGRESS — pipe them separately.\n\
+ \x20\x20\x20\x20Every run that reaches an exit — success OR error — ends with one\n\
+ \x20\x20\x20\x20terminal line, in every progress mode EXCEPT `none` (which --quiet\n\
+ \x20\x20\x20\x20selects), so an outcome never has to be guessed from silence:\n\
+ \x20\x20\x20\x20\x20\x20xerj-done ok=true exit=3 reason=completed-with-junk wall=57.6s …\n\
+ \x20\x20\x20\x20The terminal line also carries code coverage — code_files=N\n\
+ \x20\x20\x20\x20code_files_indexed=M code_files_junked=K — so a corpus whose\n\
+ \x20\x20\x20\x20source files were ALL dropped cannot print the same line as a\n\
+ \x20\x20\x20\x20healthy one. code_files>0 with code_files_indexed=0 is always a\n\
+ \x20\x20\x20\x20defect, and the run says so in words as well.\n\
+ \x20\x20\x20\x20--quiet/--progress none prints no progress and NO terminal line\n\
+ \x20\x20\x20\x20(only a fatal `error:` line, if any) — poll `autoindex status\n\
+ \x20\x20\x20\x20--state-dir <dir>` or read the exit code instead of waiting for\n\
+ \x20\x20\x20\x20output that never comes.\n\
+ \x20\x20\x20\x20(A run killed by a signal cannot print one either; a missing\n\
+ \x20\x20\x20\x20terminal line after the process is gone means it died, not that it\n\
+ \x20\x20\x20\x20finished.)\n\
+ \x20\x20\x20\x20--progress plain writes TWO lines per tick, in one write:\n\
+ \x20\x20\x20\x20xerj-bar [######################--] 93.4% | index | 8082/8083 items | eta 7s\n\
+ \x20\x20\x20\x20xerj-progress phase=index basis=bytes pct=93.4 items=8082/8083 eta_s=7.2 …\n\
+ \x20\x20\x20\x20`xerj-bar` is the DISPLAY line — self-contained, meant to be shown\n\
+ \x20\x20\x20\x20to a person verbatim by whatever is relaying the run. It is spaced\n\
+ \x20\x20\x20\x20at most one per 15s, plus one per phase change and never two closer\n\
+ \x20\x20\x20\x20than 2s, so it does not flood a transcript. Short phases therefore\n\
+ \x20\x20\x20\x20draw fewer bars than transitions — read the machine line for those.\n\
+ \x20\x20\x20\x20`xerj-progress` is the MACHINE line and keeps\n\
+ \x20\x20\x20\x20the --progress-interval cadence; parse that one. --progress json\n\
+ \x20\x20\x20\x20stays one object per line and carries the same rendered string in\n\
+ \x20\x20\x20\x20a `bar` field on the same schedule: a string on the ticks that owe\n\
+ \x20\x20\x20\x20a bar, null in between.\n\
+ \x20\x20\x20\x20Every record is identified by its leading token, and that is\n\
+ \x20\x20\x20\x20enforced: paths and other outside text are stripped of control\n\
+ \x20\x20\x20\x20characters and bounded before they reach any line, so a crafted\n\
+ \x20\x20\x20\x20filename cannot forge a record or repaint your terminal.\n\
+ \x20\x20\x20\x20`pct`/`eta_s` are the literal word `unknown` (JSON null) whenever they\n\
+ \x20\x20\x20\x20cannot be computed honestly, never a filler number — and the drawn\n\
+ \x20\x20\x20\x20bar obeys the same rule: `[????…]` when there is no denominator,\n\
+ \x20\x20\x20\x20and a full bar only at a real 100%.\n\
+ \x20\x20\x20\x20PHASES, in order. Every long step is a phase of its own, so a line\n\
+ \x20\x20\x20\x20that still says `scan` at 100% means scan — not indexing:\n\
+ \x20\x20\x20\x20\x20\x20default (graph) path: walk, hash, scan, prepare, graph, index,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20graph-corpus, finalize-refresh, finalize-count,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20finalize-correlate, finalize-histogram, finalize-catalog\n\
+ \x20\x20\x20\x20\x20\x20--no-graph path: walk, hash, scan, prepare (install mappings),\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20snapshot (seal + extract, bytes), index (sealed bulk bytes, the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20in-flight file named), finalize-catalog, finalize-refresh (one\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20refresh per dataset), finalize-verify (read-backs batched\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20into per-index digest windows, one search per window). A\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20resumed run starts at `replay` and its `index` phase\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20counts only the operations still to apply.\n\
\n\
ESTIMATE + DECISION GATE:\n\
- Phase A already reads and parses every file to sniff and sample it, so it\n\
- measures throughput per format family ON THIS MACHINE. autoindex turns that\n\
- into a RANGE (never one confident number) for the indexing phase and prints\n\
- the basis with it. Families phase A never read end to end are named and left\n\
- OUT of the arithmetic instead of being priced at some other family's rate;\n\
- if nothing could be measured, it says so and does not gate.\n\
- The range covers CLIENT-SIDE EXTRACTION only — server indexing, embedding\n\
- and network time are not in it, which is why the gate compares the upper end.\n\
- If that upper end is longer than --max-minutes and no --approve/--yes was\n\
- given, nothing is indexed: a JSON decision request goes to stdout and the\n\
- process exits 4 (a code of its own — 1 is the catch-all for real failures).\n\
- Answer by re-running the same command with --approve proceed|fast|cancel.\n\
- A person at a terminal is prompted instead — but ONLY when the question can\n\
- actually be seen. All three must hold: stdin is a terminal, stderr is a\n\
- terminal, and the progress surface is on. --quiet / --progress none silences\n\
- the question, so those runs are never prompted and never wait on stdin; a\n\
- piped or agent-driven run is not prompted either. Every un-prompted run\n\
- behaves identically: the JSON decision request goes to stdout (which --quiet\n\
- does NOT silence) and the process exits 4. The payload's\n\
- `prompt_not_offered_because` says which of the three was missing.\n\
- autoindex never waits on stdin for a question it did not print.\n\
+ \x20\x20\x20\x20Phase A already reads and parses every file to sniff and sample it, so it\n\
+ \x20\x20\x20\x20measures throughput per format family ON THIS MACHINE. autoindex turns that\n\
+ \x20\x20\x20\x20into a RANGE (never one confident number) for the indexing phase and prints\n\
+ \x20\x20\x20\x20the basis with it. Families phase A never read end to end are named and left\n\
+ \x20\x20\x20\x20OUT of the arithmetic instead of being priced at some other family's rate;\n\
+ \x20\x20\x20\x20if nothing could be measured, it says so and does not gate.\n\
+ \x20\x20\x20\x20The range covers CLIENT-SIDE EXTRACTION only — server indexing, embedding\n\
+ \x20\x20\x20\x20and network time are not in it, which is why the gate compares the upper end.\n\
+ \x20\x20\x20\x20If that upper end is longer than --max-minutes and no --approve/--yes was\n\
+ \x20\x20\x20\x20given, nothing is indexed: a JSON decision request goes to stdout and the\n\
+ \x20\x20\x20\x20process exits 4 (a code of its own — 1 is the catch-all for real failures).\n\
+ \x20\x20\x20\x20Answer by re-running the same command with --approve proceed|fast|cancel.\n\
+ \x20\x20\x20\x20A person at a terminal is prompted instead — but ONLY when the question can\n\
+ \x20\x20\x20\x20actually be seen. All three must hold: stdin is a terminal, stderr is a\n\
+ \x20\x20\x20\x20terminal, and the progress surface is on. --quiet / --progress none silences\n\
+ \x20\x20\x20\x20the question, so those runs are never prompted and never wait on stdin; a\n\
+ \x20\x20\x20\x20piped or agent-driven run is not prompted either. Every un-prompted run\n\
+ \x20\x20\x20\x20behaves identically: the JSON decision request goes to stdout (which --quiet\n\
+ \x20\x20\x20\x20does NOT silence) and the process exits 4. The payload's\n\
+ \x20\x20\x20\x20`prompt_not_offered_because` says which of the three was missing.\n\
+ \x20\x20\x20\x20autoindex never waits on stdin for a question it did not print.\n\
\n\
WORK ORDER:\n\
- Phase B drains source and documents first, then configuration, then\n\
- structured data, then logs and line files, and vendored/generated/minified\n\
- paths last — so stopping early, or searching while it runs, still gives you\n\
- the files you cared about. Inside a band the biggest file starts first (with\n\
- several workers it then runs alongside the rest instead of becoming the\n\
- tail); a single-worker run goes smallest-first instead. One exception: a file\n\
- so large that it outlasts everything ranked above it starts first whatever\n\
- band it is in. The full breakdown is printed with the plan.\n\
+ \x20\x20\x20\x20Phase B drains source and documents first, then configuration, then\n\
+ \x20\x20\x20\x20structured data, then logs and line files, and vendored/generated/minified\n\
+ \x20\x20\x20\x20paths last — so stopping early, or searching while it runs, still gives you\n\
+ \x20\x20\x20\x20the files you cared about. Inside a band the biggest file starts first (with\n\
+ \x20\x20\x20\x20several workers it then runs alongside the rest instead of becoming the\n\
+ \x20\x20\x20\x20tail); a single-worker run goes smallest-first instead. One exception: a file\n\
+ \x20\x20\x20\x20so large that it outlasts everything ranked above it starts first whatever\n\
+ \x20\x20\x20\x20band it is in. The full breakdown is printed with the plan.\n\
\n\
RESUME POLICY:\n\
- {resume_policy_help}.\n\
- On a graph-enabled or pre-generation journal the durable plan supports no-op\n\
- resume and same-path content replacement. Files added after that plan was frozen\n\
- are reported as skipped and are not indexed; --fresh rebuilds the plan in place\n\
- and picks them up. Removing an indexed file is refused there before any remote\n\
- mutation: its documents are already live and nothing on that path deletes them.\n\
- Restore the file and rerun, or rebuild — in place by deleting the published\n\
- indices and the state directory, or isolated under a new --state-dir, --prefix\n\
- and --brain (or --no-graph), validated before you switch readers.\n\
- --fresh is not cleanup and is not destination reconciliation: it never removes\n\
- stale records from the destination, and it is refused outright once a durable\n\
- corpus generation exists (re-run without it — the generated path reconciles the\n\
- change incrementally). For an independent rebuild use a new --state-dir and a\n\
- new --prefix, plus a new --brain when graph is enabled (or --no-graph).\n\
- Validate before switching readers; explicitly clean the shared\n\
- autoindex-catalog and old target only after validation.\n\
+ \x20\x20\x20\x20{resume_policy_help}.\n\
+ \x20\x20\x20\x20On a graph-enabled or pre-generation journal the durable plan supports no-op\n\
+ \x20\x20\x20\x20resume and same-path content replacement. Files added after that plan was frozen\n\
+ \x20\x20\x20\x20are reported as skipped and are not indexed; --fresh rebuilds the plan in place\n\
+ \x20\x20\x20\x20and picks them up. Removing an indexed file is refused there before any remote\n\
+ \x20\x20\x20\x20mutation: its documents are already live and nothing on that path deletes them.\n\
+ \x20\x20\x20\x20Restore the file and rerun, or rebuild — in place by deleting the published\n\
+ \x20\x20\x20\x20indices and the state directory, or isolated under a new --state-dir, --prefix\n\
+ \x20\x20\x20\x20and --brain (or --no-graph), validated before you switch readers.\n\
+ \x20\x20\x20\x20--fresh is not cleanup and is not destination reconciliation: it never removes\n\
+ \x20\x20\x20\x20stale records from the destination, and it is refused outright once a durable\n\
+ \x20\x20\x20\x20corpus generation exists (re-run without it — the generated path reconciles the\n\
+ \x20\x20\x20\x20change incrementally). For an independent rebuild use a new --state-dir and a\n\
+ \x20\x20\x20\x20new --prefix, plus a new --brain when graph is enabled (or --no-graph).\n\
+ \x20\x20\x20\x20Validate before switching readers; explicitly clean the shared\n\
+ \x20\x20\x20\x20autoindex-catalog and old target only after validation.\n\
\n\
WATCH (OBJECT STORAGE):\n\
- `xerj autoindex s3://<bucket>/<prefix> --watch` polls the bucket with\n\
- ListObjectsV2 and emits one JSON event per changed object (added / changed /\n\
- deleted) on stdout, or to --events-out. It does NOT index: pipe the feed into\n\
- the indexer. Deletes are detected only by a full scan (not --append-only).\n\
- A bucket has no inotify, so this is polling, and polling costs money:\n\
- ListObjectsV2 is a CLASS A operation, one call per page (--page-size keys,\n\
- 1,000 by default and at most), EVERY cycle,\n\
- whether anything changed or not. Cloudflare R2's free tier is 1,000,000\n\
- Class A operations a month, which is ~23 per minute for the whole account:\n\
- objects list calls/cycle every 60s every 300s (default)\n\
- 1,000 1 43,200/mo 8,640/mo\n\
- 10,000 10 432,000/mo 86,400/mo\n\
- 100,000 100 4,320,000/mo 864,000/mo\n\
- 1,000,000 1,000 43,200,000/mo 8,640,000/mo\n\
- The default interval is {default_poll}s and the default budget is\n\
- {default_budget} Class A and {default_gets} Class B operations a month (20% of each\n\
- free tier, because the rest of the account spends from it too). The budget is a\n\
- CIRCUIT BREAKER, checked on every cycle: a projection over budget (also when the\n\
- bucket grows mid-watch), or a month whose budget is spent (counted across\n\
- restarts in <state-dir>/objwatch-spend.json), STOPS the watch with exit 4 and a\n\
- decision request. --allow-cost accepts the spend, --append-only makes a growing\n\
- key space cost one call per cycle, and a narrower prefix is free.\n\
- --poll-interval <secs> seconds between cycles (default {default_poll}, max {max_poll})\n\
- --once / --max-cycles N stop after one / N cycles\n\
- --no-fetch metadata-only: compare ETag+size+mtime, never GET\n\
- --append-only list only keys above the highest one seen (start-after):\n\
- one list call per cycle, and NO delete or older-key\n\
- change detection — opt in only for an append-only\n\
- key space such as date-partitioned logs\n\
- --dry-run one cycle, no GETs, nothing emitted, no journal: price\n\
- the poll. The listing itself is real and IS billed\n\
- (ceil(keys/page-size) Class A ops, on the ledger)\n\
- --endpoint-url <URL> S3 endpoint (else AWS_ENDPOINT_URL). R2:\n\
- https://<account>.r2.cloudflarestorage.com\n\
- --region <R> signing region (else AWS_REGION, else auto)\n\
- --max-object-mb <N> byte cap per fetched object (default 64)\n\
- --max-monthly-ops <N> Class A budget per month (default {default_budget})\n\
- --max-monthly-gets <N> Class B (GET) budget per month (default {default_gets})\n\
- --allow-cost proceed although the projection is over budget\n\
- --page-size <N> keys per list call (default 1000, the API maximum)\n\
- --events-out <PATH> write the JSONL change feed here instead of stdout\n\
- --status-file <PATH> running counts an operator can read (default\n\
- <state-dir>/objwatch-status.json)\n\
- Credentials come from the environment only: AWS_ACCESS_KEY_ID,\n\
- AWS_SECRET_ACCESS_KEY, optionally AWS_SESSION_TOKEN. Never from a flag.\n\
+ \x20\x20\x20\x20`xerj autoindex s3://<bucket>/<prefix> --watch` polls the bucket with\n\
+ \x20\x20\x20\x20ListObjectsV2 and emits one JSON event per changed object (added / changed /\n\
+ \x20\x20\x20\x20deleted) on stdout, or to --events-out. It does NOT index: pipe the feed into\n\
+ \x20\x20\x20\x20the indexer. Deletes are detected only by a full scan (not --append-only).\n\
+ \x20\x20\x20\x20A bucket has no inotify, so this is polling, and polling costs money:\n\
+ \x20\x20\x20\x20ListObjectsV2 is a CLASS A operation, one call per page (--page-size keys,\n\
+ \x20\x20\x20\x201,000 by default and at most), EVERY cycle,\n\
+ \x20\x20\x20\x20whether anything changed or not. Cloudflare R2's free tier is 1,000,000\n\
+ \x20\x20\x20\x20Class A operations a month, which is ~23 per minute for the whole account:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20objects list calls/cycle every 60s every 300s (default)\n\
+ \x20\x20\x20\x20\x20\x20\x20\x201,000 1 43,200/mo 8,640/mo\n\
+ \x20\x20\x20\x20\x20\x20\x20\x2010,000 10 432,000/mo 86,400/mo\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20100,000 100 4,320,000/mo 864,000/mo\n\
+ \x20\x20\x20\x20\x20\x20\x20\x201,000,000 1,000 43,200,000/mo 8,640,000/mo\n\
+ \x20\x20\x20\x20The default interval is {default_poll}s and the default budget is\n\
+ \x20\x20\x20\x20{default_budget} Class A and {default_gets} Class B operations a month (20% of each\n\
+ \x20\x20\x20\x20free tier, because the rest of the account spends from it too). The budget is a\n\
+ \x20\x20\x20\x20CIRCUIT BREAKER, checked on every cycle: a projection over budget (also when the\n\
+ \x20\x20\x20\x20bucket grows mid-watch), or a month whose budget is spent (counted across\n\
+ \x20\x20\x20\x20restarts in <state-dir>/objwatch-spend.json), STOPS the watch with exit 4 and a\n\
+ \x20\x20\x20\x20decision request. --allow-cost accepts the spend, --append-only makes a growing\n\
+ \x20\x20\x20\x20key space cost one call per cycle, and a narrower prefix is free.\n\
+ \x20\x20\x20\x20--poll-interval <secs> seconds between cycles (default {default_poll}, max {max_poll})\n\
+ \x20\x20\x20\x20--once / --max-cycles N stop after one / N cycles\n\
+ \x20\x20\x20\x20--no-fetch metadata-only: compare ETag+size+mtime, never GET\n\
+ \x20\x20\x20\x20--append-only list only keys above the highest one seen (start-after):\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20one list call per cycle, and NO delete or older-key\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20change detection — opt in only for an append-only\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20key space such as date-partitioned logs\n\
+ \x20\x20\x20\x20--dry-run one cycle, no GETs, nothing emitted, no journal: price\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the poll. The listing itself is real and IS billed\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(ceil(keys/page-size) Class A ops, on the ledger)\n\
+ \x20\x20\x20\x20--endpoint-url <URL> S3 endpoint (else AWS_ENDPOINT_URL). R2:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20https://<account>.r2.cloudflarestorage.com\n\
+ \x20\x20\x20\x20--region <R> signing region (else AWS_REGION, else auto)\n\
+ \x20\x20\x20\x20--max-object-mb <N> byte cap per fetched object (default 64)\n\
+ \x20\x20\x20\x20--max-monthly-ops <N> Class A budget per month (default {default_budget})\n\
+ \x20\x20\x20\x20--max-monthly-gets <N> Class B (GET) budget per month (default {default_gets})\n\
+ \x20\x20\x20\x20--allow-cost proceed although the projection is over budget\n\
+ \x20\x20\x20\x20--page-size <N> keys per list call (default 1000, the API maximum)\n\
+ \x20\x20\x20\x20--events-out <PATH> write the JSONL change feed here instead of stdout\n\
+ \x20\x20\x20\x20--status-file <PATH> running counts an operator can read (default\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<state-dir>/objwatch-status.json)\n\
+ \x20\x20\x20\x20Credentials come from the environment only: AWS_ACCESS_KEY_ID,\n\
+ \x20\x20\x20\x20AWS_SECRET_ACCESS_KEY, optionally AWS_SESSION_TOKEN. Never from a flag.\n\
\n\
EXIT CODES: 0 complete (also: gate answered with --approve cancel);\n\
- 3 completed-with-junk (junk recorded, never fatal) — this\n\
- includes a dataset whose mapping the server REFUSED: its\n\
- files are recorded as junk with the server's reason, the\n\
- xerj-done line carries datasets_refused / files_refused,\n\
- and every other dataset is indexed; or\n\
- catalog-alias-sweep-failed — the corpus IS indexed and the\n\
- journal committed; only the catalog's duplicate-alias cleanup\n\
- could not run. Read `reason` on the xerj-done line to tell the\n\
- two apart, and rerun the same command once the reported server\n\
- condition clears;\n\
- 4 NEEDS A DECISION — the estimate exceeded --max-minutes, or a\n\
- --watch poll cost more than --max-monthly-ops; nothing was\n\
- indexed and a JSON decision request is on stdout;\n\
- 2 usage; 1 endpoint/journal failure, a refused corpus removal, or a\n\
- refused unsafe state transition\n",
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x203 completed-with-junk (junk recorded, never fatal) — this\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20includes a dataset whose mapping the server REFUSED: its\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20files are recorded as junk with the server's reason, the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xerj-done line carries datasets_refused / files_refused,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20and every other dataset is indexed; or\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20catalog-alias-sweep-failed — the corpus IS indexed and the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20journal committed; only the catalog's duplicate-alias cleanup\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20could not run. Read `reason` on the xerj-done line to tell the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20two apart, and rerun the same command once the reported server\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20condition clears;\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204 NEEDS A DECISION — the estimate exceeded --max-minutes, or a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--watch poll cost more than --max-monthly-ops; nothing was\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20indexed and a JSON decision request is on stdout;\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x202 usage; 1 endpoint/journal failure, a refused corpus removal, or a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20refused unsafe state transition\n",
feedback_block = xerj_common::feedback::block(feedback),
default_poll = crate::objwatch::cost::DEFAULT_POLL_INTERVAL_SECS,
default_budget = crate::objwatch::cost::DEFAULT_MAX_MONTHLY_CLASS_A,
@@ -2505,6 +2505,34 @@ mod tests {
}
}
+ /// A `\` at the end of a help line used to eat the next line's indent, so
+ /// `--limit`'s wrap started at column 0. The wrap stays under the
+ /// description.
+ #[test]
+ fn help_keeps_the_indent_of_a_wrapped_flag_line() {
+ let help = super::help_text_with(false);
+ let lines: Vec<&str> = help.lines().collect();
+ let limit = lines
+ .iter()
+ .position(|l| l.contains("--limit <N>"))
+ .expect("--limit must be documented");
+ let wrap = lines[limit + 1];
+ assert!(
+ wrap.starts_with(' '),
+ "the --limit wrap lost its indent: {wrap:?}"
+ );
+ assert!(
+ wrap.contains("default: all of them"),
+ "expected the --limit description wrap, got {wrap:?}"
+ );
+ let flag_col = lines[limit].find("--limit").unwrap();
+ let wrap_col = wrap.find("default:").unwrap();
+ assert!(
+ wrap_col > flag_col,
+ "wrap column {wrap_col} should sit past the flag at {flag_col}"
+ );
+ }
+
/// The invitation is on by default and near the top — at the bottom of a
/// 200-line help body it would never be read. Position is the requirement,
/// so position is what is asserted.
diff --git a/engine/crates/xerj-server/src/main.rs b/engine/crates/xerj-server/src/main.rs
index 9e20473e4..bfb9a2dfc 100644
--- a/engine/crates/xerj-server/src/main.rs
+++ b/engine/crates/xerj-server/src/main.rs
@@ -253,188 +253,188 @@ fn help_text(feedback: bool) -> String {
\n\
{}\
USAGE:\n\
- xerj [OPTIONS] start the server (options below)\n\
- xerj autoindex <folder> [OPTIONS] zero-config discovery + indexing — the\n\
- flagship path for most agents (see xerj\n\
- autoindex --help)\n\
- xerj autoindex map print the discovered data map\n\
- xerj code <corpus> \"<query>\" reference-coding retrieval over a corpus\n\
- of peer projects (see xerj code --help)\n\
- xerj corpus add|index|list the corpus lifecycle behind `xerj code`\n\
- (see xerj corpus --help)\n\
+ \x20\x20\x20\x20xerj [OPTIONS] start the server (options below)\n\
+ \x20\x20\x20\x20xerj autoindex <folder> [OPTIONS] zero-config discovery + indexing — the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flagship path for most agents (see xerj\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20autoindex --help)\n\
+ \x20\x20\x20\x20xerj autoindex map print the discovered data map\n\
+ \x20\x20\x20\x20xerj code <corpus> \"<query>\" reference-coding retrieval over a corpus\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20of peer projects (see xerj code --help)\n\
+ \x20\x20\x20\x20xerj corpus add|index|list the corpus lifecycle behind `xerj code`\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(see xerj corpus --help)\n\
{ask_lines}\
xerj index [OPTIONS] direct NDJSON → engine ingest (see xerj\n\
- index --help)\n\
- xerj brain <folder> index + browse in one command (see xerj\n\
- brain --help)\n\
- xerj share <index|folder> give someone read-only search over one\n\
- index: link + passcode + expiry (see xerj\n\
- share --help)\n\
- xerj feedback [OPTIONS] draft the agent field report (and open its\n\
- PR) — see xerj feedback --help\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20index --help)\n\
+ \x20\x20\x20\x20xerj brain <folder> index + browse in one command (see xerj\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20brain --help)\n\
+ \x20\x20\x20\x20xerj share <index|folder> give someone read-only search over one\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20index: link + passcode + expiry (see xerj\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20share --help)\n\
+ \x20\x20\x20\x20xerj feedback [OPTIONS] draft the agent field report (and open its\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PR) — see xerj feedback --help\n\
\n\
OPTIONS (for `xerj [OPTIONS]`, the bare server start):\n\
- --config, -c <PATH> Path to TOML config file. CORS is off by default (no\n\
- Access-Control-* headers); a browser app calling the node\n\
- directly needs [cors] allowed_origins =\n\
- [\"http://localhost:8080\"] there (allow_any_origin = true\n\
- is for local development only)\n\
- --data-dir, -d <PATH> Override data directory\n\
- --bind, -b <ADDR> Interface to bind every listener to. Default 127.0.0.1 —\n\
- loopback only, reachable from this machine and nowhere\n\
- else. Pass 0.0.0.0 (or a specific address) to expose the\n\
- node; with TLS off that also needs\n\
- server.allow_insecure_network_bind = true (or\n\
- XERJ_ALLOW_INSECURE_NETWORK_BIND=true), because every\n\
- request — API key included — would cross the network in\n\
- cleartext. Env: XERJ_BIND_ADDRESS\n\
- --insecure, -k Disable TLS *and* API-key authentication — local dev only.\n\
- Auth is ON by default, so without this flag every client\n\
- (`xerj autoindex` and `xerj brain` included) must send the\n\
- key this server writes to <data_dir>/admin.key on first\n\
- start — export XERJ_API_KEY=$(cat ./data/admin.key)\n\
- --embed-mode <MODE> Embedding backend: lexical | neural | proxy | auto |\n\
- onnx-experimental\n\
- lexical built-in feature-hash (default; offline, not neural)\n\
- neural built-in BERT (all-MiniLM-L6-v2) — real semantics,\n\
- in-process; auto-downloads the model (~90 MB) on\n\
- first use, then runs from cache. Just add the flag.\n\
- proxy external OpenAI-compatible /v1/embeddings endpoint\n\
- auto proxy if embedding.default_endpoint is set, else lexical\n\
- onnx-experimental local all-MiniLM-L6-v2-compatible FP32\n\
- ONNX prototype; width 384, named BERT inputs and\n\
- token output; requires matching tokenizer.json;\n\
- no auto-download\n\
- --onnx-model <PATH> compatible FP32 MiniLM ONNX model\n\
- --onnx-tokenizer <PATH> tokenizer.json from the same model/export\n\
- --compat-distribution <DIST> Force the wire-compat client identity: elasticsearch |\n\
- opensearch. Default: unset — xerj auto-detects per request\n\
- from the caller's User-Agent header instead (an\n\
- opensearch-py/opensearch-js client — including OpenSearch\n\
- Dashboards itself — and an elasticsearch-py/elasticsearch-js\n\
- client hitting the SAME running instance each see GET / and\n\
- GET /_nodes shaped for their own ecosystem). Setting this\n\
- pins ALL clients to one identity regardless of User-Agent —\n\
- useful if a client sends no recognizable User-Agent, or you\n\
- just want deterministic behavior.\n\
- Example: --compat-distribution opensearch\n\
- --compat-version <VER> Force the reported version.number (e.g. 2.11.0). Default:\n\
- unset — when auto-detected as OpenSearch, reports a fixed\n\
- version verified to pass OpenSearch Dashboards' own\n\
- compatibility check (not the calling client's own version —\n\
- client library versions aren't a reliable stand-in for a\n\
- compatible server version, confirmed against a real OSD\n\
- container). Example: --compat-version 2.11.0\n\
- --decide-mode <MODE> System One decide ladder (/v1/systemone, /_decide):\n\
- history | local (default history — the labelled-history\n\
- vote, today's contract). `local` arms the tier-2 zero-shot\n\
- decision head, which answers the questions the history\n\
- vote cannot (no [decisions] index, no labelled neighbour)\n\
- instead of 503/422. Needs --decide-model-dir (or\n\
- XERJ_DECIDE_MODEL_DIR) naming a directory with\n\
- config.json, tokenizer.json and model.safetensors, and a\n\
- build with the decide-local feature\n\
- (cargo build --release -p xerj-server --features\n\
- decide-local). Env: XERJ_DECIDE_MODE\n\
- --decide-model-dir <PATH> Directory holding the tier-2 decide head's\n\
- config.json, tokenizer.json and model.safetensors —\n\
- local file only, no download path. Env:\n\
- XERJ_DECIDE_MODEL_DIR\n\
- --port <PORT> Port for the Elasticsearch-compatible API (default 9200).\n\
- When given, also claims PORT+1 for the native REST API and\n\
- PORT+2 for gRPC, so a second instance needs only this one\n\
- flag: xerj --insecure --port 9300 -d ./other-data\n\
- Without it the native REST API listens on 8080 and gRPC on\n\
- 8081 ([server] rest_port / grpc_port in the TOML config).\n\
- --auto-port Opt in to multi-instance mode: if a port is taken, bind the\n\
- next free one; if the data dir is held by another live\n\
- process, use <data-dir>-2, -3, ... The banner prints the\n\
- ports actually bound. Off by default. Env: XERJ_AUTO_PORT\n\
- --no-auto-port Fail at startup if a port is taken (the default).\n\
- --disable-feedback Do not print the feedback invitation above. Honoured in any\n\
- position, including after --help. Env:\n\
- XERJ_DISABLE_FEEDBACK=true\n\
- --help, -h Show this help\n\
- --version, -V Print version and exit\n\
+ \x20\x20\x20\x20--config, -c <PATH> Path to TOML config file. CORS is off by default (no\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Access-Control-* headers); a browser app calling the node\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20directly needs [cors] allowed_origins =\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20[\"http://localhost:8080\"] there (allow_any_origin = true\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20is for local development only)\n\
+ \x20\x20\x20\x20--data-dir, -d <PATH> Override data directory\n\
+ \x20\x20\x20\x20--bind, -b <ADDR> Interface to bind every listener to. Default 127.0.0.1 —\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loopback only, reachable from this machine and nowhere\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20else. Pass 0.0.0.0 (or a specific address) to expose the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20node; with TLS off that also needs\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20server.allow_insecure_network_bind = true (or\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20XERJ_ALLOW_INSECURE_NETWORK_BIND=true), because every\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20request — API key included — would cross the network in\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cleartext. Env: XERJ_BIND_ADDRESS\n\
+ \x20\x20\x20\x20--insecure, -k Disable TLS *and* API-key authentication — local dev only.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Auth is ON by default, so without this flag every client\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(`xerj autoindex` and `xerj brain` included) must send the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20key this server writes to <data_dir>/admin.key on first\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20start — export XERJ_API_KEY=$(cat ./data/admin.key)\n\
+ \x20\x20\x20\x20--embed-mode <MODE> Embedding backend: lexical | neural | proxy | auto |\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20onnx-experimental\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20lexical built-in feature-hash (default; offline, not neural)\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20neural built-in BERT (all-MiniLM-L6-v2) — real semantics,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20in-process; auto-downloads the model (~90 MB) on\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20first use, then runs from cache. Just add the flag.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20proxy external OpenAI-compatible /v1/embeddings endpoint\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auto proxy if embedding.default_endpoint is set, else lexical\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20onnx-experimental local all-MiniLM-L6-v2-compatible FP32\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ONNX prototype; width 384, named BERT inputs and\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20token output; requires matching tokenizer.json;\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20no auto-download\n\
+ \x20\x20\x20\x20--onnx-model <PATH> compatible FP32 MiniLM ONNX model\n\
+ \x20\x20\x20\x20--onnx-tokenizer <PATH> tokenizer.json from the same model/export\n\
+ \x20\x20\x20\x20--compat-distribution <DIST> Force the wire-compat client identity: elasticsearch |\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20opensearch. Default: unset — xerj auto-detects per request\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20from the caller's User-Agent header instead (an\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20opensearch-py/opensearch-js client — including OpenSearch\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Dashboards itself — and an elasticsearch-py/elasticsearch-js\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20client hitting the SAME running instance each see GET / and\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20GET /_nodes shaped for their own ecosystem). Setting this\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20pins ALL clients to one identity regardless of User-Agent —\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20useful if a client sends no recognizable User-Agent, or you\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20just want deterministic behavior.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Example: --compat-distribution opensearch\n\
+ \x20\x20\x20\x20--compat-version <VER> Force the reported version.number (e.g. 2.11.0). Default:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unset — when auto-detected as OpenSearch, reports a fixed\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20version verified to pass OpenSearch Dashboards' own\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20compatibility check (not the calling client's own version —\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20client library versions aren't a reliable stand-in for a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20compatible server version, confirmed against a real OSD\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20container). Example: --compat-version 2.11.0\n\
+ \x20\x20\x20\x20--decide-mode <MODE> System One decide ladder (/v1/systemone, /_decide):\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20history | local (default history — the labelled-history\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vote, today's contract). `local` arms the tier-2 zero-shot\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20decision head, which answers the questions the history\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20vote cannot (no [decisions] index, no labelled neighbour)\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20instead of 503/422. Needs --decide-model-dir (or\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20XERJ_DECIDE_MODEL_DIR) naming a directory with\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20config.json, tokenizer.json and model.safetensors, and a\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20build with the decide-local feature\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(cargo build --release -p xerj-server --features\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20decide-local). Env: XERJ_DECIDE_MODE\n\
+ \x20\x20\x20\x20--decide-model-dir <PATH> Directory holding the tier-2 decide head's\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20config.json, tokenizer.json and model.safetensors —\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20local file only, no download path. Env:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20XERJ_DECIDE_MODEL_DIR\n\
+ \x20\x20\x20\x20--port <PORT> Port for the Elasticsearch-compatible API (default 9200).\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20When given, also claims PORT+1 for the native REST API and\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PORT+2 for gRPC, so a second instance needs only this one\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flag: xerj --insecure --port 9300 -d ./other-data\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Without it the native REST API listens on 8080 and gRPC on\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x208081 ([server] rest_port / grpc_port in the TOML config).\n\
+ \x20\x20\x20\x20--auto-port Opt in to multi-instance mode: if a port is taken, bind the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20next free one; if the data dir is held by another live\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20process, use <data-dir>-2, -3, ... The banner prints the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ports actually bound. Off by default. Env: XERJ_AUTO_PORT\n\
+ \x20\x20\x20\x20--no-auto-port Fail at startup if a port is taken (the default).\n\
+ \x20\x20\x20\x20--disable-feedback Do not print the feedback invitation above. Honoured in any\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position, including after --help. Env:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20XERJ_DISABLE_FEEDBACK=true\n\
+ \x20\x20\x20\x20--help, -h Show this help\n\
+ \x20\x20\x20\x20--version, -V Print version and exit\n\
\n\
SUBCOMMANDS:\n\
- xerj index <opts> direct NDJSON → engine ingest (see xerj index --help)\n\
- xerj autoindex <folder> [opts] zero-config folder discovery + indexing (see xerj autoindex --help)\n\
- xerj autoindex map print the discovered data map\n\
- xerj search \"<text>\" retrieve code/passages from a running node — the\n\
- query client, no wrapper scripts (see xerj search --help)\n\
- xerj def \"<symbol>\" go-to-definition: where is this symbol defined, and\n\
- what is its signature (see xerj def --help)\n\
- xerj code <corpus> \"<q>\" reference-coding retrieval: how did peer projects\n\
- solve this (see xerj code --help)\n\
- xerj corpus add|index|list clone + index + list the reference corpora that\n\
- `xerj code` searches (see xerj corpus --help)\n\
- xerj init wire XERJ into the coding agents in this project:\n\
- MCP + skill files, one command (see xerj init --help)\n\
- xerj gain what this node did for you, counted from the audit\n\
- log — searches, hit rate, latency (xerj gain --help)\n\
- xerj brain <folder> one command: index a folder into a running, browsable\n\
- second brain in your browser (see xerj brain --help)\n\
- xerj mcp [opts] Model Context Protocol stdio server: exposes {mcp_tools} tools\n\
- (search, semantic, vector, hybrid, memory, second-brain,\n\
- map, plan, code-search, Corpus Hub) to any MCP client.\n\
- Proxies to a node you already started — set XERJ_URL or\n\
- --url (see xerj mcp --help)\n\
- xerj feedback [opts] draft the agent field report XERJ asks every agent to\n\
- file, auto-filling version/OS/what-was-indexed; --open-pr\n\
- files it, --dry-run just prints (see xerj feedback --help)\n\
+ \x20\x20\x20\x20xerj index <opts> direct NDJSON → engine ingest (see xerj index --help)\n\
+ \x20\x20\x20\x20xerj autoindex <folder> [opts] zero-config folder discovery + indexing (see xerj autoindex --help)\n\
+ \x20\x20\x20\x20xerj autoindex map print the discovered data map\n\
+ \x20\x20\x20\x20xerj search \"<text>\" retrieve code/passages from a running node — the\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20query client, no wrapper scripts (see xerj search --help)\n\
+ \x20\x20\x20\x20xerj def \"<symbol>\" go-to-definition: where is this symbol defined, and\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20what is its signature (see xerj def --help)\n\
+ \x20\x20\x20\x20xerj code <corpus> \"<q>\" reference-coding retrieval: how did peer projects\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20solve this (see xerj code --help)\n\
+ \x20\x20\x20\x20xerj corpus add|index|list clone + index + list the reference corpora that\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20`xerj code` searches (see xerj corpus --help)\n\
+ \x20\x20\x20\x20xerj init wire XERJ into the coding agents in this project:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20MCP + skill files, one command (see xerj init --help)\n\
+ \x20\x20\x20\x20xerj gain what this node did for you, counted from the audit\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20log — searches, hit rate, latency (xerj gain --help)\n\
+ \x20\x20\x20\x20xerj brain <folder> one command: index a folder into a running, browsable\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20second brain in your browser (see xerj brain --help)\n\
+ \x20\x20\x20\x20xerj mcp [opts] Model Context Protocol stdio server: exposes {mcp_tools} tools\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(search, semantic, vector, hybrid, memory, second-brain,\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20map, plan, code-search, Corpus Hub) to any MCP client.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Proxies to a node you already started — set XERJ_URL or\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--url (see xerj mcp --help)\n\
+ \x20\x20\x20\x20xerj feedback [opts] draft the agent field report XERJ asks every agent to\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20file, auto-filling version/OS/what-was-indexed; --open-pr\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20files it, --dry-run just prints (see xerj feedback --help)\n\
\n\
SEARCHING A CODEBASE:\n\
- A search hit returns the whole indexed document, which for source code is the\n\
- whole file. To get only the matching function or class, ask for the passage:\n\
+ \x20\x20\x20\x20A search hit returns the whole indexed document, which for source code is the\n\
+ \x20\x20\x20\x20whole file. To get only the matching function or class, ask for the passage:\n\
\n\
- curl -s $URL/<index>/_search -H 'Content-Type: application/json' \\\n\
- -d '{{\"query\":{{\"bool\":{{\"should\":[{{\"multi_match\":{{\"query\":\"<symbol or phrase>\",\n\
- \"fields\":[\"body\",\"defs\"],\"type\":\"most_fields\"}}}},{{\"match_phrase\":{{\"defs\":{{\"query\":\"<symbol or phrase>\",\"boost\":4}}}}}}]}}}},\n\
- \"_source\":[\"ax_path\",\"title\"],\"fields\":[\"_passage\"]}}'\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20curl -s $URL/<index>/_search -H 'Content-Type: application/json' \\\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-d '{{\"query\":{{\"bool\":{{\"should\":[{{\"multi_match\":{{\"query\":\"<symbol or phrase>\",\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\"fields\":[\"body\",\"defs\"],\"type\":\"most_fields\"}}}},{{\"match_phrase\":{{\"defs\":{{\"query\":\"<symbol or phrase>\",\"boost\":4}}}}}}]}}}},\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\"_source\":[\"ax_path\",\"title\"],\"fields\":[\"_passage\"]}}'\n\
\n\
- the `match_phrase` clause ranks the file that DEFINES a symbol above files that merely call it;\n\
- `_passage` returns the enclosing block. Without them you get whole files.\n\
+ \x20\x20\x20\x20the `match_phrase` clause ranks the file that DEFINES a symbol above files that merely call it;\n\
+ \x20\x20\x20\x20`_passage` returns the enclosing block. Without them you get whole files.\n\
\n\
ENVIRONMENT:\n\
- XERJ_LOG Log level filter (default: info)\n\
- XERJ_DISABLE_FEEDBACK true/false — same as --disable-feedback, for callers that\n\
- cannot change the command line (CI, containers, agents)\n\
- XERJ_CONFIG Config file path\n\
- XERJ_EMBED_MODE Embedding backend (lexical|neural|proxy|auto|onnx-experimental)\n\
- XERJ_ONNX_MODEL FP32 ONNX model path\n\
- XERJ_ONNX_TOKENIZER matching tokenizer.json path\n\
- XERJ_COMPAT_DISTRIBUTION elasticsearch|opensearch — same as --compat-distribution\n\
- XERJ_COMPAT_VERSION same as --compat-version\n\
- XERJ_DECIDE_MODE decide ladder: history|local — same as --decide-mode\n\
- XERJ_DECIDE_MODEL_DIR tier-2 decide head's model directory — same as\n\
- --decide-model-dir\n\
- XERJ_INGEST_MEMORY_TRACE off|summary (default: off); summary emits bounded\n\
- periodic NDJSON diagnostics, never per-item events\n\
- XERJ_INGEST_MEMORY_SAMPLE_MS sampler period, clamped to 25..60000 ms\n\
- XERJ_INGEST_MEMORY_OUTPUT tracing|<PATH> (default: tracing); append NDJSON to path\n\
- Merge/cache fields are reserved/unavailable in v1.\n\
- Active+drained may transiently overlap across sampling.\n\
+ \x20\x20\x20\x20XERJ_LOG Log level filter (default: info)\n\
+ \x20\x20\x20\x20XERJ_DISABLE_FEEDBACK true/false — same as --disable-feedback, for callers that\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cannot change the command line (CI, containers, agents)\n\
+ \x20\x20\x20\x20XERJ_CONFIG Config file path\n\
+ \x20\x20\x20\x20XERJ_EMBED_MODE Embedding backend (lexical|neural|proxy|auto|onnx-experimental)\n\
+ \x20\x20\x20\x20XERJ_ONNX_MODEL FP32 ONNX model path\n\
+ \x20\x20\x20\x20XERJ_ONNX_TOKENIZER matching tokenizer.json path\n\
+ \x20\x20\x20\x20XERJ_COMPAT_DISTRIBUTION elasticsearch|opensearch — same as --compat-distribution\n\
+ \x20\x20\x20\x20XERJ_COMPAT_VERSION same as --compat-version\n\
+ \x20\x20\x20\x20XERJ_DECIDE_MODE decide ladder: history|local — same as --decide-mode\n\
+ \x20\x20\x20\x20XERJ_DECIDE_MODEL_DIR tier-2 decide head's model directory — same as\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--decide-model-dir\n\
+ \x20\x20\x20\x20XERJ_INGEST_MEMORY_TRACE off|summary (default: off); summary emits bounded\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20periodic NDJSON diagnostics, never per-item events\n\
+ \x20\x20\x20\x20XERJ_INGEST_MEMORY_SAMPLE_MS sampler period, clamped to 25..60000 ms\n\
+ \x20\x20\x20\x20XERJ_INGEST_MEMORY_OUTPUT tracing|<PATH> (default: tracing); append NDJSON to path\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Merge/cache fields are reserved/unavailable in v1.\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Active+drained may transiently overlap across sampling.\n\
\n\
WIRE-COMPAT IDENTITY — three ways to run this, pick what fits:\n\
\n\
- 1. Fully automatic (default, no flags):\n\
- xerj -d ./data\n\
- Every client gets a response shaped for its own ecosystem, detected from its\n\
- User-Agent on every request. One instance serves ES and OpenSearch clients at\n\
- once.\n\
+ \x20\x20\x20\x201. Fully automatic (default, no flags):\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20xerj -d ./data\n\
+ \x20\x20\x20\x20\x20\x20\x20Every client gets a response shaped for its own ecosystem, detected from its\n\
+ \x20\x20\x20\x20\x20\x20\x20User-Agent on every request. One instance serves ES and OpenSearch clients at\n\
+ \x20\x20\x20\x20\x20\x20\x20once.\n\
\n\
- 2. Force one identity for every client, every request:\n\
- xerj -d ./data --compat-distribution opensearch --compat-version 2.11.0\n\
- Or via env (handy in docker-compose):\n\
- XERJ_COMPAT_DISTRIBUTION=opensearch XERJ_COMPAT_VERSION=2.11.0 xerj -d ./data\n\
- Ignores User-Agent entirely — useful for a client that doesn't send one, or when\n\
- you want fully deterministic behavior.\n\
+ \x20\x20\x20\x202. Force one identity for every client, every request:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20xerj -d ./data --compat-distribution opensearch --compat-version 2.11.0\n\
+ \x20\x20\x20\x20\x20\x20\x20Or via env (handy in docker-compose):\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20XERJ_COMPAT_DISTRIBUTION=opensearch XERJ_COMPAT_VERSION=2.11.0 xerj -d ./data\n\
+ \x20\x20\x20\x20\x20\x20\x20Ignores User-Agent entirely — useful for a client that doesn't send one, or when\n\
+ \x20\x20\x20\x20\x20\x20\x20you want fully deterministic behavior.\n\
\n\
- 3. Pin only the distribution, let the version auto-detect per client:\n\
- xerj -d ./data --compat-distribution opensearch\n\
- (or set only XERJ_COMPAT_VERSION and leave distribution to auto-detect — the two\n\
- settings are resolved independently, mix and match as needed.)\n",
+ \x20\x20\x20\x203. Pin only the distribution, let the version auto-detect per client:\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20xerj -d ./data --compat-distribution opensearch\n\
+ \x20\x20\x20\x20\x20\x20\x20(or set only XERJ_COMPAT_VERSION and leave distribution to auto-detect — the two\n\
+ \x20\x20\x20\x20\x20\x20\x20settings are resolved independently, mix and match as needed.)\n",
env!("CARGO_PKG_VERSION"),
xerj_common::feedback::block(feedback),
// Counted from the served `tools/list`, not typed: the literal "13"
@@ -1503,19 +1503,19 @@ fn index_help_text(feedback: bool) -> String {
\n\
{}\
USAGE:\n\
- xerj index --index <name> --file <ndjson> [OPTIONS]\n\
+ \x20\x20\x20\x20xerj index --index <name> --file <ndjson> [OPTIONS]\n\
\n\
OPTIONS:\n\
- --index, -i <NAME> Target index name (required)\n\
- --file, -f <PATH> Path to NDJSON file (required)\n\
- --batch, -b <N> Docs per batch (default 5000)\n\
- --workers, -w <N> Parallel ingest workers (default = num_cpus)\n\
- --limit, -l <N> Ingest only the first N lines (default: all)\n\
- --config, -c <PATH> Path to TOML config file\n\
- --data-dir, -d <PATH> Override data directory\n\
- --disable-feedback Do not print the feedback invitation above\n\
- (env XERJ_DISABLE_FEEDBACK=true)\n\
- --help, -h Show this help\n\
+ \x20\x20\x20\x20--index, -i <NAME> Target index name (required)\n\
+ \x20\x20\x20\x20--file, -f <PATH> Path to NDJSON file (required)\n\
+ \x20\x20\x20\x20--batch, -b <N> Docs per batch (default 5000)\n\
+ \x20\x20\x20\x20--workers, -w <N> Parallel ingest workers (default = num_cpus)\n\
+ \x20\x20\x20\x20--limit, -l <N> Ingest only the first N lines (default: all)\n\
+ \x20\x20\x20\x20--config, -c <PATH> Path to TOML config file\n\
+ \x20\x20\x20\x20--data-dir, -d <PATH> Override data directory\n\
+ \x20\x20\x20\x20--disable-feedback Do not print the feedback invitation above\n\
+ \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(env XERJ_DISABLE_FEEDBACK=true)\n\
+ \x20\x20\x20\x20--help, -h Show this help\n\
\n\
Bypasses HTTP/axum entirely. Bytes are pushed straight into\n\
index_batch_turbo_raw via rayon workers. Use this for maximum\n\
@@ -2182,6 +2182,38 @@ mod help_text_tests {
"the help must name the env var that carries the key, got:\n{para}"
);
}
+
+ /// A trailing `\` in the help string must not eat the indent of the next
+ /// line. `--insecure`'s wrap lines up under its description, not column 0.
+ #[test]
+ fn help_keeps_the_indent_of_a_wrapped_flag_line() {
+ let help = help_text(false);
+ let lines: Vec<&str> = help.lines().collect();
+ let flag = lines
+ .iter()
+ .position(|l| l.contains("--insecure"))
+ .expect("--insecure must be documented");
+ let wrap = lines[flag + 1];
+ assert!(
+ wrap.starts_with(' '),
+ "the --insecure wrap lost its indent: {wrap:?}"
+ );
+ assert!(
+ wrap.contains("Auth is ON by default"),
+ "expected the --insecure description wrap, got {wrap:?}"
+ );
+ let index = super::index_help_text(false);
+ let index_lines: Vec<&str> = index.lines().collect();
+ let fb = index_lines
+ .iter()
+ .position(|l| l.contains("--disable-feedback"))
+ .expect("index help documents --disable-feedback");
+ assert!(
+ index_lines[fb + 1].starts_with(' '),
+ "index help wrap lost its indent: {:?}",
+ index_lines[fb + 1]
+ );
+ }
}
/// `--decide-mode` / `--decide-model-dir` (#1057 tier 2): the CLI grammar and