Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkgs/atlas-search/book/development/release-and-rollout.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ them on. The standing examples:
the `Install` section arrived at the step-6 cutover. A new service
role follows the same shape — declared, inert, enabled by a separate
deliberate change.
- **Experimental search paths are off by default and hidden**: the
shard fan-out behind the hidden `--shards` flag is the CLI-side
example. Hidden and off is the correct posture for a path whose
- **Experimental search paths are off by default**: the shard
fan-out behind the EXPERIMENTAL `--shards` flag is the CLI-side
example. Off by default is the correct posture for a path whose
evidence is still being gathered.

The rule for a new flag: name it, state its default as a literal value
Expand Down
6 changes: 3 additions & 3 deletions pkgs/atlas-search/book/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ parity and evaluation instrument, not the install path.

## What gets installed

One package installs exactly six binaries, all version `0.1.0` where a
version surface exists:
One package installs exactly six binaries, all version `0.1.0`,
each with a `--version` surface:

| Binary | What it is |
| --- | --- |
| `atlas-search` | The access layer: `search`, `get-chunk`, `serve`, `init`, `fetch-model`, `traces`, and `feedback`. The package's `mainProgram`. `--version` prints `atlas-search 0.1.0`. |
| `atlas-stage` | Staging units and the staging registry: `provision`, `lookup`, `ingest`, `items`, `promote`, `units`. It has no `--version` flag — passing one is a usage error, exit 2 (source behaviour; the other hand-rolled tools below likewise have no version surface). |
| `atlas-stage` | Staging units and the staging registry: `provision`, `lookup`, `ingest`, `items`, `promote`, `units`. `--version` prints `atlas-stage 0.1.0`. |
| `atlas-classify` | The classification operating procedure: `run`, `schema-review`, `schema-apply` against a corpus database. |
| `atlas-eval` | The offline ranking-evaluation runner: two positional arguments, an eval document and a `dev` or `test` split. |
| `atlas-sweep` | The ingestion sweep runner: pause/resume a source class, run one sweep request, manage dead letters, report. It creates no schedule; cadence is an operator decision. |
Expand Down
29 changes: 15 additions & 14 deletions pkgs/atlas-search/book/reference/atlas-classify.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Source: `pkgs/atlas-search/crates/atlas-core/src/bin/atlas-classify.rs`, with de

Two facts govern everything about this binary, and both are stated plainly here because its own help states neither:

- **Exit code 2 is the only failure code — for everything.** Usage errors *and* runtime/classification failures all exit 2. This binary has **no exit-1 path**. That includes `--help`: there is no successful help path (see below).
- **The help text states no defaults.** The usage text shows only invocation shapes. Every default in the tables below exists **only in source** and is marked *source-only* as such.
- **Exit code 2 is the only failure code — for everything.** Usage errors *and* runtime/classification failures all exit 2. This binary has **no exit-1 path**. (`--help` and `--version` are not failures: both print to stdout and exit 0 — see below.)
- **The usage text states the defaults.** Its final line lists every default; the tables below repeat them.

## Invocation and the strict parser

Expand All @@ -18,9 +18,10 @@ usage:
atlas-classify --db CORPUS run [--commit] [--window-days N] [--actor A] [--now TS] [--schema-version N] [--max-decisions N] [--manifest-out PATH]
atlas-classify --db CORPUS schema-review --old-schema F --new-schema F [--reviewer-model M] [--reviewer-model-version V] [--manifest-out PATH]
atlas-classify --db CORPUS schema-apply --review F --dispositions F [--now TS] [--manifest-out PATH]
defaults: --window-days 90; --actor atlas-classify/remainder-sweep; --schema-version 1; --reviewer-model atlas-classify; --reviewer-model-version the crate version; --now the current time; --max-decisions unbounded
```

**There is no `--help`.** Every invocation shape other than the three documented actions — bare invocation, `--help`, `run --help`, unknown flags, unknown actions, a flag given twice, a missing flag value — prints the usage text to **stderr** and exits **2**.
**`--help` / `-h`** prints the usage text to **stdout** and exits **0**, from any position in the argv; **`--version` / `-V`** prints `atlas-classify 0.1.0`, exit 0. Every other invocation shape other than the three documented actions — bare invocation, unknown flags, unknown actions, a flag given twice, a missing flag value — prints the usage text to **stderr** and exits **2**.

The global flag:

Expand All @@ -43,11 +44,11 @@ atlas-classify --db CORPUS run [--commit] [--window-days N] [--actor A] [--now T
| Flag | Argument | Default | Meaning |
|---|---|---|---|
| `--commit` | switch | off | Commit the run: write one classification record per candidate. Without it, the run is a dry-run that only prints the manifest. |
| `--window-days` | integer (i64, ≥ 0) | `90` — *source-only* (the `DEFAULT_WINDOW_DAYS` constant; the help states no default) | The relatedness window, in days. |
| `--actor` | string | `atlas-classify/remainder-sweep` — *source-only* (the run configuration's default) | The actor name recorded for the run's decisions. |
| `--now` | string (timestamp) | current time as ISO-8601 — *source-only* | The run's notion of now. |
| `--schema-version` | integer (u64) | `1` — *source-only* (the `CURRENT_SCHEMA_VERSION` constant) | The classification schema version to classify under. |
| `--max-decisions` | integer (u64) | none (run to completion) — *source-only* | Cap the run at N decisions. |
| `--window-days` | integer (i64, ≥ 0) | `90` (the `DEFAULT_WINDOW_DAYS` constant; also stated in the usage text) | The relatedness window, in days. |
| `--actor` | string | `atlas-classify/remainder-sweep` (the run configuration's default) | The actor name recorded for the run's decisions. |
| `--now` | string (timestamp) | current time as ISO-8601 | The run's notion of now. |
| `--schema-version` | integer (u64) | `1` (the `CURRENT_SCHEMA_VERSION` constant) | The classification schema version to classify under. |
| `--max-decisions` | integer (u64) | none (run to completion) | Cap the run at N decisions. |
| `--manifest-out` | path | — (none) | Also write the manifest to this file. The manifest is always printed to stdout as pretty JSON regardless. |

Non-integer or negative values are exit-2 errors naming the flag, e.g. `--window-days must be an integer`, `--window-days must not be negative`.
Expand All @@ -64,8 +65,8 @@ Compares two schema documents section by section — changed sections only, unle
|---|---|---|---|
| `--old-schema` | path | — (required) | The current schema document. |
| `--new-schema` | path | — (required) | The proposed schema document. |
| `--reviewer-model` | string | `atlas-classify` — *source-only* | The reviewing model name recorded in the batch's provenance. |
| `--reviewer-model-version` | string | `0.1.0` — *source-only* (the crate version, from the build environment) | The reviewing model version recorded in the batch's provenance. |
| `--reviewer-model` | string | `atlas-classify` | The reviewing model name recorded in the batch's provenance. |
| `--reviewer-model-version` | string | `0.1.0` (the crate version, from the build environment) | The reviewing model version recorded in the batch's provenance. |
| `--manifest-out` | path | — (none) | Also write the review batch to this file; it is always printed to stdout as pretty JSON. |

## `schema-apply`: apply a reviewed schema change
Expand All @@ -80,7 +81,7 @@ Applies a review batch's proposals. Each proposal is applied **only** with a rev
|---|---|---|---|
| `--review` | path | — (required) | The review batch file produced by `schema-review`. |
| `--dispositions` | path | — (required) | The dispositions file: one reviewed disposition per proposal to apply. |
| `--now` | string (timestamp) | current time — *source-only* | The apply's notion of now. |
| `--now` | string (timestamp) | current time | The apply's notion of now. |
| `--manifest-out` | path | — (none) | Also write the report to this file; it is always printed to stdout as pretty JSON. |

## Worked examples
Expand Down Expand Up @@ -111,22 +112,22 @@ $ atlas-classify --db /tmp/toy-corpus.db schema-review --old-schema /tmp/toy-sch
$ atlas-classify --db /tmp/toy-corpus.db schema-apply --review /tmp/toy-review.json --dispositions /tmp/toy-dispositions.json
```

Asking for help demonstrates the parser contract — usage on stderr, exit 2:
Asking for help prints the usage text to stdout and exits 0:

```
$ atlas-classify --help
usage:
atlas-classify --db CORPUS run [--commit] [--window-days N] [--actor A] [--now TS] [--schema-version N] [--max-decisions N] [--manifest-out PATH]
…
$ echo $?
2
0
```

## Failure shapes

All failures print `atlas-classify: <msg>` (or, for usage errors, the usage text) to stderr and exit **2**. There are no other failure shapes.

- Bare invocation, `--help`, `run --help`, an unknown action, an unknown flag, a duplicated flag, or a missing flag value: the usage text on stderr, exit 2.
- Bare invocation, an unknown action, an unknown flag, a duplicated flag, or a missing flag value: the usage text on stderr, exit 2.
- `--db` missing, or given twice (`--db given twice`): exit 2.
- A required action flag missing (e.g. `schema-review` without `--new-schema`): exit 2.
- A malformed numeric value: an error naming the flag (`--window-days must be an integer`, `--window-days must not be negative`), exit 2.
Expand Down
6 changes: 3 additions & 3 deletions pkgs/atlas-search/book/reference/atlas-eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Source: [pkgs/atlas-search/crates/atlas-core/src/bin/atlas-eval.rs](https://gith
atlas-eval <eval.json> <dev|test>
```

There are no flags. `--help`, `-h`, and `help` are not recognised: each falls into the wrong-arity path, prints the one-line usage text to stderr, and exits 2.
There are no option flags. `--help` / `-h` prints the one-line usage text to stdout and exits 0; `--version` / `-V` prints `atlas-eval 0.1.0`, exit 0. The literal word `help` is not recognised: it falls into the wrong-arity path, prints the usage text to stderr, and exits 2.

| Flag | Argument | Default | Meaning |
|---|---|---|---|
| (none) | — | — | This binary takes no `--flag` options at all. |
| (none) | — | — | This binary takes no `--flag` options beyond `--help` / `--version`. |
| `&lt;eval.json&gt;` (positional 1) | path to an `atlas-eval/v1` document | required | The evaluation input: queries, qrels, and saved rankings (see below). |
| `&lt;dev\|test&gt;` (positional 2) | `dev` or `test` | required | Which split of the input document to score. Any other value is an error: `atlas-eval: unknown split "…" (want dev\|test)`. |

Expand Down Expand Up @@ -84,7 +84,7 @@ The report's per-signal means carry the four metrics above — `ndcg10`, `recall

## Failure shapes

- Wrong number of arguments, or an unrecognised split: the usage line (or the `unknown split` message) on stderr, exit 2. This includes every spelling of a help request.
- Wrong number of arguments, or an unrecognised split: the usage line (or the `unknown split` message) on stderr, exit 2.
- The input file cannot be read: `atlas-eval: cannot read &lt;path&gt;: &lt;error&gt;`, exit 1.
- The input parses but is invalid `atlas-eval/v1` data (any validation rule above), or evaluation itself fails: `atlas-eval: &lt;error&gt;`, exit 1. No partial report is printed.

Expand Down
6 changes: 3 additions & 3 deletions pkgs/atlas-search/book/reference/atlas-github-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Source: [pkgs/atlas-search/crates/atlas-core/src/bin/atlas-github-comments.rs](h

`atlas-github-comments` is a one-verb writer: it extracts GitHub comments — issue comments, pull-request review comments, and pull-request reviews — from the repositories Drew controls, and appends them as `atlas-github-comment/v1` records to a JSONL file, so the comments become a corpus source (source class `github comments`, source id `github-comments`). There are no subcommands and no other mode; the single invocation below is the whole tool.

There is no help output at all. The complete surface exists only in the source header, and — stated plainly, because it surprises everyone — **every failure in this binary exits 1, including pure argument errors**. `--help` is not a help path; it is an unknown argument, exit 1. There is no exit-2 path.
The complete surface exists only in the source header. `--help` / `-h` prints the usage line to stdout, exit 0, and `--version` / `-V` prints `atlas-github-comments 0.1.0` — and, stated plainly, because it surprises everyone: **every failure in this binary exits 1, including pure argument errors**. There is no exit-2 path.

## Invocation

Expand All @@ -20,7 +20,7 @@ atlas-github-comments --state <watermarks.json> --out <records.jsonl> [--repo <o
| `--skip-reviews` | (switch) | off | Skip the per-PR reviews walk (issue comments and review comments are still extracted). |
| `--observed-date` | `YYYY-MM-DD` | today, UTC (via `date -u +%F`) | The observation date stamped on the emitted documents. |

Any other argument — including `--help`, `-h`, and the literal word `help` — is `atlas-github-comments: unknown argument: &lt;arg&gt;`, exit 1. A flag missing its value is named the same way, for example `--state needs a path`, exit 1.
Any other argument — including the literal word `help` — is `atlas-github-comments: unknown argument: &lt;arg&gt;`, exit 1. A flag missing its value is named the same way, for example `--state needs a path`, exit 1.

## Behaviour

Expand Down Expand Up @@ -57,7 +57,7 @@ Running the identical command again appends nothing for that repository unless n

## Failure shapes

- Missing `--state` or `--out`, an unknown argument (including `--help`), or a flag missing its value: `atlas-github-comments: &lt;message&gt;` on stderr, exit 1.
- Missing `--state` or `--out`, an unknown argument, or a flag missing its value: `atlas-github-comments: &lt;message&gt;` on stderr, exit 1.
- A `gh` failure mid-run: the run stops, watermarks saved so far stay saved, the error notes `(state saved; rerun resumes)`, exit 1.
- File errors on the state or output paths: exit 1.
- The one non-failure: HTTP 451 repositories are skipped and counted, and do not by themselves change the exit code.
Expand Down
8 changes: 4 additions & 4 deletions pkgs/atlas-search/book/reference/atlas-search-admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ atlas-search serve [OPTIONS]

| Flag | Argument | Default | Meaning |
|---|---|---|---|
| `--config` | path | `~/.local/state/atlas-search/service.json` | Service config path. Environment variable: `ATLAS_SEARCH_SERVICE_CONFIG` (honoured by the program, not by clap — the help text names it, the mechanism is a manual lookup). |
| `--config` | path | `~/.local/state/atlas-search/service.json` | Service config path. Environment variable: `ATLAS_SEARCH_SERVICE_CONFIG` (a clap env binding on the flag; a set-but-empty value counts as absent, as the previous manual lookup treated it). |
| `--listen` | address | from the config (`127.0.0.1:18760`) | Listen address override. Loopback only. |
| `--job-ttl-ms` | integer (milliseconds) | `600000` | Completed-job TTL override: how long a finished job is retained. |
| `--hard-ttl-ms` | integer (milliseconds) | `3600000` | Submit hard-cap override: the longest a submitted job may run. |
Expand Down Expand Up @@ -57,7 +57,7 @@ The config document body is `{"listen": "127.0.0.1:18760", "vec_table": &lt;defa

| Flag | Argument | Default | Meaning |
|---|---|---|---|
| `--config` | path | `~/.local/state/atlas-search/service.json` | Service config path. Environment variable: `ATLAS_SEARCH_SERVICE_CONFIG` (honoured manually, as on `serve`). |
| `--config` | path | `~/.local/state/atlas-search/service.json` | Service config path. Environment variable: `ATLAS_SEARCH_SERVICE_CONFIG` (a clap env binding, as on `serve`). |
| `--force` | switch | off | Replace an existing config. This **rotates every client token**: all existing callers must be re-provisioned with the new tokens. |

Without `--force`, an existing config is an exit-2 error. On success the output prints the config path and each client's cap — never token values.
Expand Down Expand Up @@ -107,7 +107,7 @@ The five sub-verbs:
| `report` | Weekly statistics report into the statistics-and-reports source set. Takes `--dir`, `--today`, `--feedback`. See the undocumented files below. |
| `normalise` | Agent normalisation pass over the raw feedback store, using the traces directory for query requester identities. Takes `--dir`, `--feedback-dir`, `--out-dir`, `--today`. |

**The report files the help text never mentions.** `traces report`'s help says only "weekly statistics report into the statistics-and-reports source set". The source behaviour is more: the verb also writes the report JSON file **and a Markdown file**, `atlas-statistics-report-&lt;day&gt;.md`, into the traces dir, and reports both paths in its JSON output as `report_file` and `markdown_file`. This is source behaviour, stated here because the help text does not state it.
**The report files.** `traces report` writes more than its one-line summary suggests: the verb writes the report JSON file **and a Markdown file**, `atlas-statistics-report-&lt;day&gt;.md`, into the traces dir, and reports both paths in its JSON output as `report_file` and `markdown_file`. The help text names both files.

`--today` values are strictly calendar-validated in `retention`, `stats`, `report` and `normalise`: an invalid date is exit 2, `--today must be a valid YYYY-MM-DD date, got &lt;value&gt;`. The retention horizon is 180 days (`HOT_RETENTION_DAYS`).

Expand Down Expand Up @@ -136,7 +136,7 @@ atlas-search feedback [OPTIONS] --query <QUERY>
| `--via-service` | switch | off | Go through a running service instead of the local store. |
| `--service-url` | URL | the default service URL | Service base URL for `--via-service`. Environment variable: `ATLAS_SEARCH_URL`. |

**The vote-shape rule the help text does not state.** Without `--get`, exactly one of `--up` / `--down` is required — but neither flag is marked required in the help, and the rule is enforced only at runtime: casting with neither is exit 2, `atlas-search: feedback needs exactly one of --up / --down (or --get to retrieve)`. Passing both is a clap conflict error, also exit 2. A `@file` comment whose file cannot be read is exit 1.
**The vote-shape rule.** Without `--get`, exactly one of `--up` / `--down` is required — the help states the rule, and it is enforced at runtime: casting with neither is exit 2, `atlas-search: feedback needs exactly one of --up / --down (or --get to retrieve)`. Passing both is a clap conflict error, also exit 2. A `@file` comment whose file cannot be read is exit 1.

## Worked examples

Expand Down
Loading