Commit e1a5578
Make the CLI usable on Windows, and honest about what it indexed
The binary could not run at all on Windows, and several indexing verbs
reported success for work they had not done.
Unusable:
* Every verb — `version`, `doctor`, `index stats`, even `--help` — died
with "thread 'main' has overflowed its stack". Building this clap tree
costs more stack than MSVC's 1 MiB main thread; Linux gives 8 MiB. The
project already knew the tree is stack-hungry and had worked around it
twice for *tests* (`RUST_MIN_STACK` in ci.yml, 16 MiB test threads);
neither protects the shipped binary. `cli::run()` now runs on a thread
whose stack it sets itself.
* `crispsorter --version` opened the GUI. `SUBCOMMANDS` — the argv sniff
that decides CLI-vs-GUI — listed `--help`/`-h` but not `--version`/`-V`.
The drift test that exists to prevent exactly this walked
`get_subcommands()`, which never contains clap's self-handled flags. It
now derives them from the built command tree instead.
Dishonest:
* A path that does not exist printed "skip (not found)" and exited 0. A
disconnected network share therefore read as a successful index of
nothing. Same for a run where every candidate was filtered out.
* A document that yielded no text was reported as a plain success. It
lands in the FTS index but never in LanceDB, so it is absent from
`index list` and matched by no query, while `index stats` still counts
it. Ingesting 24 books, two of them scans, gave "22 ingested" for 20
searchable documents with nothing to say so. Now: `∅ (no text
extracted)`, a separate count, the list of files, and a pointer to
`--ocr`.
* `--model <typo>` silently fell back to BGE-M3, quietly building a
1024-wide index the user had not asked for. `parse_embedder_model` is
now strict and shared with `index init`.
New surface, all defaulting to previous behaviour: `--ocr` (the ingest
path hardcoded `try_ocr: false`, so a folder of scans indexed as empty
documents), `--timeout` (matching bg_ingest's 300 s; there was no bound at
all, so one pathological PDF stalled a whole folder), `--mode
keyword|semantic|hybrid` (ingest computed and stored embeddings that no
CLI path could query), `--backend`/`--quant`, `--max-file-size`, `--ext`.
`paths.ps1` bootstraps Strawberry Perl. `openssl = { features =
["vendored"] }` compiles OpenSSL from source and OpenSSL's `Configure` is
a Perl program; the GitHub Windows runners ship one, a dev box has Git for
Windows' MSYS perl, and that one lacks `Locale::Maketext::Simple`. So the
question is not "is perl on PATH" — it always is — but whether it can
load what OpenSSL needs, which is what the probe checks. Failing this way
costs an hour: openssl-sys builds after ~2,800 crates.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 6094004 commit e1a5578
2 files changed
Lines changed: 923 additions & 94 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
99 | 167 | | |
100 | 168 | | |
101 | 169 | | |
| |||
0 commit comments