Skip to main content

aube_codes/
errors.rs

1//! Error codes (`ERR_AUBE_*`).
2//!
3//! Each constant's *value* matches its identifier. The `ALL` slice
4//! is the registry — it gates the generated docs page
5//! (`docs/error-codes.md`, produced by the
6//! `generate-error-codes-docs` binary) and the self-tests in
7//! `lib.rs`. New codes go in both places: define a `pub const`,
8//! then add a [`crate::CodeMeta`] entry to `ALL` carrying the
9//! category, one-line description, and (optional) bespoke exit
10//! code.
11
12use crate::CodeMeta;
13
14// ── lockfile ─────────────────────────────────────────────────────────
15pub const ERR_AUBE_NO_LOCKFILE: &str = "ERR_AUBE_NO_LOCKFILE";
16pub const ERR_AUBE_LOCKFILE_PARSE: &str = "ERR_AUBE_LOCKFILE_PARSE";
17pub const ERR_AUBE_LOCKFILE_UNSUPPORTED_FORMAT: &str = "ERR_AUBE_LOCKFILE_UNSUPPORTED_FORMAT";
18
19// ── resolver ─────────────────────────────────────────────────────────
20pub const ERR_AUBE_NO_MATCHING_VERSION: &str = "ERR_AUBE_NO_MATCHING_VERSION";
21pub const ERR_AUBE_NO_MATURE_MATCHING_VERSION: &str = "ERR_AUBE_NO_MATURE_MATCHING_VERSION";
22pub const ERR_AUBE_REGISTRY_ERROR: &str = "ERR_AUBE_REGISTRY_ERROR";
23pub const ERR_AUBE_UNKNOWN_CATALOG: &str = "ERR_AUBE_UNKNOWN_CATALOG";
24pub const ERR_AUBE_UNKNOWN_CATALOG_ENTRY: &str = "ERR_AUBE_UNKNOWN_CATALOG_ENTRY";
25pub const ERR_AUBE_BLOCKED_EXOTIC_SUBDEP: &str = "ERR_AUBE_BLOCKED_EXOTIC_SUBDEP";
26pub const ERR_AUBE_TRUST_DOWNGRADE: &str = "ERR_AUBE_TRUST_DOWNGRADE";
27pub const ERR_AUBE_TRUST_MISSING_TIME: &str = "ERR_AUBE_TRUST_MISSING_TIME";
28// `#[rustfmt::skip]` keeps the long names on a single visual line so the
29// declaration list reads as a flat table — rustfmt would otherwise wrap
30// to a `name: &str =\n    "name";` two-liner for any const past col 100.
31#[rustfmt::skip] pub const ERR_AUBE_TRUST_EXCLUDE_INVALID_VERSION_UNION: &str = "ERR_AUBE_TRUST_EXCLUDE_INVALID_VERSION_UNION";
32#[rustfmt::skip] pub const ERR_AUBE_TRUST_EXCLUDE_NAME_GLOB_WITH_VERSIONS: &str = "ERR_AUBE_TRUST_EXCLUDE_NAME_GLOB_WITH_VERSIONS";
33pub const ERR_AUBE_PEER_CONTEXT_NOT_CONVERGED: &str = "ERR_AUBE_PEER_CONTEXT_NOT_CONVERGED";
34
35// ── registry / network ──────────────────────────────────────────────
36pub const ERR_AUBE_PACKAGE_NOT_FOUND: &str = "ERR_AUBE_PACKAGE_NOT_FOUND";
37pub const ERR_AUBE_VERSION_NOT_FOUND: &str = "ERR_AUBE_VERSION_NOT_FOUND";
38pub const ERR_AUBE_UNAUTHORIZED: &str = "ERR_AUBE_UNAUTHORIZED";
39pub const ERR_AUBE_OFFLINE: &str = "ERR_AUBE_OFFLINE";
40pub const ERR_AUBE_INVALID_PACKAGE_NAME: &str = "ERR_AUBE_INVALID_PACKAGE_NAME";
41pub const ERR_AUBE_REGISTRY_WRITE_REJECTED: &str = "ERR_AUBE_REGISTRY_WRITE_REJECTED";
42pub const ERR_AUBE_MALICIOUS_PACKAGE: &str = "ERR_AUBE_MALICIOUS_PACKAGE";
43pub const ERR_AUBE_LOW_DOWNLOAD_PACKAGE: &str = "ERR_AUBE_LOW_DOWNLOAD_PACKAGE";
44pub const ERR_AUBE_ADVISORY_CHECK_FAILED: &str = "ERR_AUBE_ADVISORY_CHECK_FAILED";
45pub const ERR_AUBE_SECURITY_SCANNER_FATAL: &str = "ERR_AUBE_SECURITY_SCANNER_FATAL";
46pub const ERR_AUBE_SECURITY_SCANNER_FAILED: &str = "ERR_AUBE_SECURITY_SCANNER_FAILED";
47
48// ── tarball / store ─────────────────────────────────────────────────
49pub const ERR_AUBE_TARBALL_INTEGRITY: &str = "ERR_AUBE_TARBALL_INTEGRITY";
50pub const ERR_AUBE_TARBALL_EXTRACT: &str = "ERR_AUBE_TARBALL_EXTRACT";
51pub const ERR_AUBE_PKG_CONTENT_MISMATCH: &str = "ERR_AUBE_PKG_CONTENT_MISMATCH";
52pub const ERR_AUBE_NO_HOME: &str = "ERR_AUBE_NO_HOME";
53pub const ERR_AUBE_GIT_ERROR: &str = "ERR_AUBE_GIT_ERROR";
54
55// ── linker ──────────────────────────────────────────────────────────
56pub const ERR_AUBE_LINK_FAILED: &str = "ERR_AUBE_LINK_FAILED";
57pub const ERR_AUBE_PATCH_FAILED: &str = "ERR_AUBE_PATCH_FAILED";
58pub const ERR_AUBE_MISSING_PACKAGE_INDEX: &str = "ERR_AUBE_MISSING_PACKAGE_INDEX";
59pub const ERR_AUBE_UNSAFE_INDEX_KEY: &str = "ERR_AUBE_UNSAFE_INDEX_KEY";
60pub const ERR_AUBE_MISSING_STORE_FILE: &str = "ERR_AUBE_MISSING_STORE_FILE";
61
62// ── scripts ─────────────────────────────────────────────────────────
63pub const ERR_AUBE_SCRIPT_SPAWN: &str = "ERR_AUBE_SCRIPT_SPAWN";
64pub const ERR_AUBE_SCRIPT_NON_ZERO_EXIT: &str = "ERR_AUBE_SCRIPT_NON_ZERO_EXIT";
65#[rustfmt::skip] pub const ERR_AUBE_BUILD_POLICY_UNSUPPORTED_VALUE: &str = "ERR_AUBE_BUILD_POLICY_UNSUPPORTED_VALUE";
66#[rustfmt::skip] pub const ERR_AUBE_BUILD_POLICY_INVALID_VERSION_UNION: &str = "ERR_AUBE_BUILD_POLICY_INVALID_VERSION_UNION";
67#[rustfmt::skip] pub const ERR_AUBE_BUILD_POLICY_WILDCARD_WITH_VERSION: &str = "ERR_AUBE_BUILD_POLICY_WILDCARD_WITH_VERSION";
68
69// ── workspace / filter ──────────────────────────────────────────────
70pub const ERR_AUBE_WORKSPACE_PARSE: &str = "ERR_AUBE_WORKSPACE_PARSE";
71pub const ERR_AUBE_FILTER_EMPTY: &str = "ERR_AUBE_FILTER_EMPTY";
72pub const ERR_AUBE_FILTER_GIT_IO: &str = "ERR_AUBE_FILTER_GIT_IO";
73pub const ERR_AUBE_FILTER_GIT_FAILED: &str = "ERR_AUBE_FILTER_GIT_FAILED";
74
75// ── manifest ────────────────────────────────────────────────────────
76pub const ERR_AUBE_MANIFEST_PARSE: &str = "ERR_AUBE_MANIFEST_PARSE";
77pub const ERR_AUBE_MANIFEST_YAML_PARSE: &str = "ERR_AUBE_MANIFEST_YAML_PARSE";
78
79// ── engine / cli ────────────────────────────────────────────────────
80pub const ERR_AUBE_UNSUPPORTED_ENGINE: &str = "ERR_AUBE_UNSUPPORTED_ENGINE";
81pub const ERR_AUBE_RECURSIVE_NOT_SUPPORTED: &str = "ERR_AUBE_RECURSIVE_NOT_SUPPORTED";
82pub const ERR_AUBE_UNKNOWN_COMMAND: &str = "ERR_AUBE_UNKNOWN_COMMAND";
83pub const ERR_AUBE_NPM_ONLY_COMMAND: &str = "ERR_AUBE_NPM_ONLY_COMMAND";
84pub const ERR_AUBE_COMPLETION_FAILED: &str = "ERR_AUBE_COMPLETION_FAILED";
85pub const ERR_AUBE_REMOVE_PRIOR_INSTALL_DIR: &str = "ERR_AUBE_REMOVE_PRIOR_INSTALL_DIR";
86pub const ERR_AUBE_CONFIG_NESTED_AUBE_KEY: &str = "ERR_AUBE_CONFIG_NESTED_AUBE_KEY";
87
88// ── misc tracing::error! sites (non-fatal but high-severity) ────────
89pub const ERR_AUBE_PATCHES_TRACKING_WRITE: &str = "ERR_AUBE_PATCHES_TRACKING_WRITE";
90pub const ERR_AUBE_UNSAFE_SHEBANG_INTERPRETER: &str = "ERR_AUBE_UNSAFE_SHEBANG_INTERPRETER";
91
92/// Stable category labels that group codes in the generated docs and
93/// in `EXIT_TABLE`'s 10-wide allocation ranges. Public so the docs
94/// generator can iterate them in a deterministic order.
95pub mod category {
96    pub const LOCKFILE: &str = "Lockfile";
97    pub const RESOLVER: &str = "Resolver";
98    pub const TARBALL_STORE: &str = "Tarball / store";
99    pub const REGISTRY_NETWORK: &str = "Registry / network";
100    pub const SCRIPTS: &str = "Scripts / build";
101    pub const LINKER: &str = "Linker";
102    pub const MANIFEST_WORKSPACE: &str = "Manifest / workspace";
103    pub const ENGINE_CLI: &str = "Engine / CLI";
104    pub const MISC_SAFETY: &str = "Misc / safety";
105    /// Add-time / install-time supply-chain policy errors. Paired
106    /// with [`crate::warnings::category::SUPPLY_CHAIN`].
107    pub const SUPPLY_CHAIN: &str = "Supply chain (add-time)";
108}
109
110/// Registry of every error code with its category, description, and
111/// (optional) bespoke exit code. Walked by the
112/// `generate-error-codes-docs` binary and by the self-tests in
113/// `lib.rs` and `exit.rs`. New codes must be added here.
114pub const ALL: &[CodeMeta] = &[
115    // Lockfile
116    CodeMeta {
117        name: ERR_AUBE_NO_LOCKFILE,
118        category: category::LOCKFILE,
119        description: "An operation that required a lockfile (`--frozen-lockfile`, `aube fetch`, etc.) found none in the project.",
120        exit_code: Some(10),
121    },
122    CodeMeta {
123        name: ERR_AUBE_LOCKFILE_PARSE,
124        category: category::LOCKFILE,
125        description: "Lockfile is structurally invalid — version guard failed, YAML shape is wrong, or `yaml_serde` couldn't round-trip the contents.",
126        exit_code: Some(11),
127    },
128    CodeMeta {
129        name: ERR_AUBE_LOCKFILE_UNSUPPORTED_FORMAT,
130        category: category::LOCKFILE,
131        description: "Lockfile filename was recognized but its format isn't supported on this aube version.",
132        exit_code: Some(12),
133    },
134    // Resolver
135    CodeMeta {
136        name: ERR_AUBE_NO_MATCHING_VERSION,
137        category: category::RESOLVER,
138        description: "No published version of the named package satisfies the requested range.",
139        exit_code: Some(20),
140    },
141    CodeMeta {
142        name: ERR_AUBE_NO_MATURE_MATCHING_VERSION,
143        category: category::RESOLVER,
144        description: "A version satisfying the range exists but every candidate was younger than `minimumReleaseAge` and `minimumReleaseAgeStrict=true`.",
145        exit_code: Some(21),
146    },
147    CodeMeta {
148        name: ERR_AUBE_BLOCKED_EXOTIC_SUBDEP,
149        category: category::RESOLVER,
150        description: "Transitive dep used a `git:` / `file:` / `tarball` specifier and `blockExoticSubdeps=true`.",
151        exit_code: Some(22),
152    },
153    CodeMeta {
154        name: ERR_AUBE_TRUST_DOWNGRADE,
155        category: category::RESOLVER,
156        description: "Picked version dropped trust evidence the prior version had (`trustPolicy=no-downgrade`).",
157        exit_code: Some(23),
158    },
159    CodeMeta {
160        name: ERR_AUBE_TRUST_MISSING_TIME,
161        category: category::RESOLVER,
162        description: "Registry's packument has no `time` entry for the picked version (`trustPolicy=no-downgrade`).",
163        exit_code: Some(24),
164    },
165    CodeMeta {
166        name: ERR_AUBE_UNKNOWN_CATALOG,
167        category: category::RESOLVER,
168        description: "A `catalog:<name>` reference was used but the catalog isn't defined.",
169        exit_code: Some(25),
170    },
171    CodeMeta {
172        name: ERR_AUBE_UNKNOWN_CATALOG_ENTRY,
173        category: category::RESOLVER,
174        description: "The catalog exists but has no entry for the requested package.",
175        exit_code: Some(26),
176    },
177    CodeMeta {
178        name: ERR_AUBE_PEER_CONTEXT_NOT_CONVERGED,
179        category: category::RESOLVER,
180        description: "Peer-context fixed-point loop hit `MAX_ITERATIONS=16` without converging — usually mutually-recursive peers.",
181        exit_code: Some(27),
182    },
183    CodeMeta {
184        name: ERR_AUBE_REGISTRY_ERROR,
185        category: category::RESOLVER,
186        description: "Generic registry error from inside the resolver.",
187        exit_code: None,
188    },
189    CodeMeta {
190        name: ERR_AUBE_TRUST_EXCLUDE_INVALID_VERSION_UNION,
191        category: category::RESOLVER,
192        description: "A `trustPolicyExclude` pattern had a non-exact version.",
193        exit_code: None,
194    },
195    CodeMeta {
196        name: ERR_AUBE_TRUST_EXCLUDE_NAME_GLOB_WITH_VERSIONS,
197        category: category::RESOLVER,
198        description: "A `trustPolicyExclude` pattern combined a name glob with versions.",
199        exit_code: None,
200    },
201    // Tarball / store
202    CodeMeta {
203        name: ERR_AUBE_TARBALL_INTEGRITY,
204        category: category::TARBALL_STORE,
205        description: "Downloaded tarball's hash didn't match the lockfile's / packument's `dist.integrity`.",
206        exit_code: Some(30),
207    },
208    CodeMeta {
209        name: ERR_AUBE_TARBALL_EXTRACT,
210        category: category::TARBALL_STORE,
211        description: "Tarball couldn't be extracted (corrupt gzip, unexpected entry shape, etc.).",
212        exit_code: Some(31),
213    },
214    CodeMeta {
215        name: ERR_AUBE_PKG_CONTENT_MISMATCH,
216        category: category::TARBALL_STORE,
217        description: "Tarball's `package.json` declared a different `(name, version)` than the resolver expected (`strictStorePkgContentCheck=true`).",
218        exit_code: Some(32),
219    },
220    CodeMeta {
221        name: ERR_AUBE_GIT_ERROR,
222        category: category::TARBALL_STORE,
223        description: "Git operation failed during a `git:` dep prepare or checkout.",
224        exit_code: Some(33),
225    },
226    CodeMeta {
227        name: ERR_AUBE_NO_HOME,
228        category: category::TARBALL_STORE,
229        description: "`HOME` (or platform equivalent) is unset, so aube can't locate its store.",
230        exit_code: None,
231    },
232    // Registry / network
233    CodeMeta {
234        name: ERR_AUBE_PACKAGE_NOT_FOUND,
235        category: category::REGISTRY_NETWORK,
236        description: "Registry returned 404 for the package name.",
237        exit_code: Some(40),
238    },
239    CodeMeta {
240        name: ERR_AUBE_VERSION_NOT_FOUND,
241        category: category::REGISTRY_NETWORK,
242        description: "Package exists but the requested version doesn't.",
243        exit_code: Some(41),
244    },
245    CodeMeta {
246        name: ERR_AUBE_UNAUTHORIZED,
247        category: category::REGISTRY_NETWORK,
248        description: "Registry returned 401/403 — missing or invalid auth. Run `aube login`.",
249        exit_code: Some(42),
250    },
251    CodeMeta {
252        name: ERR_AUBE_OFFLINE,
253        category: category::REGISTRY_NETWORK,
254        description: "Offline mode and the requested resource isn't in the local cache.",
255        exit_code: Some(43),
256    },
257    CodeMeta {
258        name: ERR_AUBE_INVALID_PACKAGE_NAME,
259        category: category::REGISTRY_NETWORK,
260        description: "A name doesn't match npm's grammar — rejected before any I/O so a hostile manifest can't use the cache-path builder as a write primitive.",
261        exit_code: Some(44),
262    },
263    CodeMeta {
264        name: ERR_AUBE_REGISTRY_WRITE_REJECTED,
265        category: category::REGISTRY_NETWORK,
266        description: "Registry rejected a publish/deprecate/owner write with a non-2xx response.",
267        exit_code: Some(45),
268    },
269    CodeMeta {
270        name: ERR_AUBE_MALICIOUS_PACKAGE,
271        category: category::REGISTRY_NETWORK,
272        description: "`aube add` refused a package because OSV reports it as malicious (`MAL-*` advisory). Hard block — confirmed-malicious advisories aren't a judgement call.",
273        exit_code: Some(46),
274    },
275    CodeMeta {
276        name: ERR_AUBE_LOW_DOWNLOAD_PACKAGE,
277        category: category::REGISTRY_NETWORK,
278        description: "`aube add` refused a package whose weekly downloads fall below `lowDownloadThreshold` in a non-interactive context (or when stdin is not a TTY). Pass `--allow-low-downloads` to bypass.",
279        exit_code: Some(47),
280    },
281    CodeMeta {
282        name: ERR_AUBE_ADVISORY_CHECK_FAILED,
283        category: category::REGISTRY_NETWORK,
284        description: "`aube add` couldn't reach the OSV advisory API and `advisoryCheck = required` is set. Distinct from `ERR_AUBE_MALICIOUS_PACKAGE` so CI tooling can tell a network outage from a confirmed malicious advisory.",
285        exit_code: Some(49),
286    },
287    CodeMeta {
288        name: ERR_AUBE_SECURITY_SCANNER_FATAL,
289        category: category::SUPPLY_CHAIN,
290        description: "User-configured `securityScanner` returned a `fatal`-level advisory against a package the user is trying to add. Bun-style pluggable scanner contract; the scanner itself decides what counts as fatal.",
291        exit_code: Some(48),
292    },
293    CodeMeta {
294        name: ERR_AUBE_SECURITY_SCANNER_FAILED,
295        category: category::SUPPLY_CHAIN,
296        description: "User-configured `securityScanner` couldn't be spawned, exited non-zero, timed out, or emitted unparseable JSON. Fail-closed by design: a configured scanner that can't run is treated as a refusal, not a free pass. Set `securityScanner = \"\"` to disable the integration when bootstrapping or recovering from a broken scanner.",
297        exit_code: None,
298    },
299    // Scripts / build
300    CodeMeta {
301        name: ERR_AUBE_SCRIPT_NON_ZERO_EXIT,
302        category: category::SCRIPTS,
303        description: "A lifecycle script (`preinstall` / `install` / `postinstall` / a `package.json` script) exited non-zero.",
304        exit_code: Some(50),
305    },
306    CodeMeta {
307        name: ERR_AUBE_SCRIPT_SPAWN,
308        category: category::SCRIPTS,
309        description: "Couldn't spawn a script's interpreter (shell missing, jail setup failed, etc.).",
310        exit_code: Some(51),
311    },
312    CodeMeta {
313        name: ERR_AUBE_BUILD_POLICY_UNSUPPORTED_VALUE,
314        category: category::SCRIPTS,
315        description: "An entry in `allowBuilds` had a value that wasn't `true`/`false`.",
316        exit_code: None,
317    },
318    CodeMeta {
319        name: ERR_AUBE_BUILD_POLICY_INVALID_VERSION_UNION,
320        category: category::SCRIPTS,
321        description: "An `allowBuilds` pattern's version union was unparseable.",
322        exit_code: None,
323    },
324    CodeMeta {
325        name: ERR_AUBE_BUILD_POLICY_WILDCARD_WITH_VERSION,
326        category: category::SCRIPTS,
327        description: "An `allowBuilds` pattern combined a wildcard name with a version union.",
328        exit_code: None,
329    },
330    // Linker
331    CodeMeta {
332        name: ERR_AUBE_PATCH_FAILED,
333        category: category::LINKER,
334        description: "Applying a `pnpm.patchedDependencies` patch failed.",
335        exit_code: Some(60),
336    },
337    CodeMeta {
338        name: ERR_AUBE_LINK_FAILED,
339        category: category::LINKER,
340        description: "Symlink / junction / hardlink couldn't be created — usually permissions or filesystem support.",
341        exit_code: Some(61),
342    },
343    CodeMeta {
344        name: ERR_AUBE_MISSING_PACKAGE_INDEX,
345        category: category::LINKER,
346        description: "Internal: a caller skipped `load_index` but the package wasn't already materialized.",
347        exit_code: Some(62),
348    },
349    CodeMeta {
350        name: ERR_AUBE_MISSING_STORE_FILE,
351        category: category::LINKER,
352        description: "A package index references a CAS shard that doesn't exist on disk. Re-run install to re-fetch.",
353        exit_code: Some(63),
354    },
355    // Manifest / workspace
356    CodeMeta {
357        name: ERR_AUBE_MANIFEST_PARSE,
358        category: category::MANIFEST_WORKSPACE,
359        description: "A `package.json` had a syntax error. miette renders a pointer at the offending byte.",
360        exit_code: Some(70),
361    },
362    CodeMeta {
363        name: ERR_AUBE_WORKSPACE_PARSE,
364        category: category::MANIFEST_WORKSPACE,
365        description: "An `aube-workspace.yaml` / `pnpm-workspace.yaml` was structurally invalid.",
366        exit_code: Some(71),
367    },
368    CodeMeta {
369        name: ERR_AUBE_MANIFEST_YAML_PARSE,
370        category: category::MANIFEST_WORKSPACE,
371        description: "A workspace YAML helper file was structurally invalid (no source pointer available).",
372        exit_code: None,
373    },
374    CodeMeta {
375        name: ERR_AUBE_FILTER_EMPTY,
376        category: category::MANIFEST_WORKSPACE,
377        description: "`--filter` was passed an empty selector.",
378        exit_code: None,
379    },
380    CodeMeta {
381        name: ERR_AUBE_FILTER_GIT_IO,
382        category: category::MANIFEST_WORKSPACE,
383        description: "A `--filter ...[ref]` selector failed to spawn `git`.",
384        exit_code: None,
385    },
386    CodeMeta {
387        name: ERR_AUBE_FILTER_GIT_FAILED,
388        category: category::MANIFEST_WORKSPACE,
389        description: "The git subprocess for a `--filter ...[ref]` selector exited non-zero.",
390        exit_code: None,
391    },
392    // Engine / CLI
393    CodeMeta {
394        name: ERR_AUBE_UNSUPPORTED_ENGINE,
395        category: category::ENGINE_CLI,
396        description: "One or more packages declared an `engines` constraint incompatible with the running Node/aube and `engine-strict=true`.",
397        exit_code: Some(80),
398    },
399    CodeMeta {
400        name: ERR_AUBE_UNKNOWN_COMMAND,
401        category: category::ENGINE_CLI,
402        description: "The named subcommand isn't a built-in aube command and isn't a script in the manifest.",
403        exit_code: Some(81),
404    },
405    CodeMeta {
406        name: ERR_AUBE_NPM_ONLY_COMMAND,
407        category: category::ENGINE_CLI,
408        description: "The user invoked an npm-only command (`whoami`, `token`, `owner`, `search`, `pkg`, `set-script`) — aube doesn't implement these; use npm.",
409        exit_code: Some(82),
410    },
411    CodeMeta {
412        name: ERR_AUBE_RECURSIVE_NOT_SUPPORTED,
413        category: category::ENGINE_CLI,
414        description: "A command was invoked under `--recursive` but doesn't support recursive execution.",
415        exit_code: None,
416    },
417    CodeMeta {
418        name: ERR_AUBE_COMPLETION_FAILED,
419        category: category::ENGINE_CLI,
420        description: "`aube completion` couldn't invoke `usage` to render the shell completions.",
421        exit_code: None,
422    },
423    CodeMeta {
424        name: ERR_AUBE_REMOVE_PRIOR_INSTALL_DIR,
425        category: category::ENGINE_CLI,
426        description: "Couldn't clean up a prior global install dir before re-installing.",
427        exit_code: None,
428    },
429    CodeMeta {
430        name: ERR_AUBE_CONFIG_NESTED_AUBE_KEY,
431        category: category::ENGINE_CLI,
432        description: "`aube config set <prefix>.<sub> …` was used for a key whose prefix is an aube map setting (e.g. `allowBuilds.<pkg>`). Such nested writes would otherwise land in `.npmrc` where aube doesn't read them and npm warns/errors about the unknown key — set the map in workspace yaml or `package.json#aube.<prefix>` instead.",
433        exit_code: None,
434    },
435    // Misc / safety
436    CodeMeta {
437        name: ERR_AUBE_UNSAFE_INDEX_KEY,
438        category: category::MISC_SAFETY,
439        description: "A package index key tried to escape its directory (path traversal defense in depth).",
440        exit_code: Some(90),
441    },
442    CodeMeta {
443        name: ERR_AUBE_UNSAFE_SHEBANG_INTERPRETER,
444        category: category::MISC_SAFETY,
445        description: "A `#!` shebang named an unsafe interpreter when generating a shim — substituted with `node` instead. Surfaced as `tracing::error!` but install continues.",
446        exit_code: Some(91),
447    },
448    CodeMeta {
449        name: ERR_AUBE_PATCHES_TRACKING_WRITE,
450        category: category::MISC_SAFETY,
451        description: "Couldn't write `.aube-applied-patches.json` after applying patches. Non-fatal; next install may miss stale patched entries.",
452        exit_code: None,
453    },
454];