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