@arcforge/err 2.0.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/map.ts ADDED
@@ -0,0 +1,1044 @@
1
+ /**
2
+ * The single source of truth for every failure Axon can name. One flat map,
3
+ * one entry per unique failure — codes are never reused and never change
4
+ * once shipped (a code is a stable identity a user or a support thread can
5
+ * reference). New failures get an entry here before their call site exists;
6
+ * `err()` refuses to compile against a code this map doesn't declare.
7
+ *
8
+ * `title`/`description` are the rendering contract: title is a short,
9
+ * user-facing headline ("Agent failed to start"), description is one or two
10
+ * sentences of plain-language context — not the message, not the stack.
11
+ * Both are written for someone who has never read this codebase.
12
+ *
13
+ * `severity` replaces a bare recoverable boolean — a degrading-but-handled
14
+ * failure and a fatal one both need to reach the log, just not with the
15
+ * same weight:
16
+ * - "fatal" — the operation this belongs to did not complete. Always logged, always rendered loud.
17
+ * - "recovered" — failed, but a fallback/retry made it survivable. Logged for visibility, not alarmed.
18
+ * - "degraded" — the system continues in a lesser state (a feature disabled, a cache miss that will retry). Logged, low urgency.
19
+ */
20
+
21
+ // AxonErrorSource / AxonErrorSeverity are the wire contract — they live in
22
+ // @arcforge/types and are re-exported here so this map's entries and existing
23
+ // importers resolve them from the same place.
24
+ export type { AxonErrorSource, AxonErrorSeverity } from "@arcforge/types"
25
+ import type { AxonErrorSource, AxonErrorSeverity } from "@arcforge/types"
26
+
27
+ export type AxonErrorMapEntry = {
28
+ /** Stable short code, e.g. "AX-BOOT-001". Never reused, never renumbered. */
29
+ code: string
30
+ /** Short, user-facing headline. */
31
+ title: string
32
+ /** One or two plain-language sentences — what happened and why it matters, not a stack dump. */
33
+ description: string
34
+ source: AxonErrorSource
35
+ severity: AxonErrorSeverity
36
+ }
37
+
38
+ /**
39
+ * This map must be updated for every unique failure case.
40
+ */
41
+ export const errorMap = {
42
+ UNKNOWN: {
43
+ code: "AX-UNKNOWN-001",
44
+ title: "Unclassified Error",
45
+ description: "An error occurred that hasn't been given a proper code yet. This is itself worth fixing — see the err(cause) call site that produced it.",
46
+ source: "runtime",
47
+ severity: "fatal",
48
+ },
49
+ PROMPT_NOT_FOUND: {
50
+ code: "AX-PROMPT-001",
51
+ title: "Prompt Not Found",
52
+ description: "The requested prompt was not found in the agent's blueprint. It may not be declared, or the agent needs to be re-prepared.",
53
+ source: "runtime",
54
+ severity: "fatal",
55
+ },
56
+ PROMPT_FILE_NOT_FOUND: {
57
+ code: "AX-PROMPT-002",
58
+ title: "Prompt File Missing",
59
+ description: "The prompt is declared but its source file no longer exists on disk.",
60
+ source: "runtime",
61
+ severity: "fatal",
62
+ },
63
+ PROMPT_RENDER_FAILED: {
64
+ code: "AX-PROMPT-003",
65
+ title: "Prompt Render Failed",
66
+ description: "The prompt's source file failed to compile or render — likely a malformed SFC (content outside <template>/<script>/<style>) or an error thrown while rendering. See the cause for the underlying parser/render error.",
67
+ source: "runtime",
68
+ severity: "fatal",
69
+ },
70
+ SCRIPT_NOT_FOUND: {
71
+ code: "AX-SCRIPT-001",
72
+ title: "Script Not Found",
73
+ description: "The requested script was not found in the agent's blueprint. It may not be declared, or the agent needs to be re-prepared.",
74
+ source: "runtime",
75
+ severity: "fatal",
76
+ },
77
+ SCRIPT_FILE_NOT_FOUND: {
78
+ code: "AX-SCRIPT-002",
79
+ title: "Script File Missing",
80
+ description: "The script is declared but its source file no longer exists on disk.",
81
+ source: "runtime",
82
+ severity: "fatal",
83
+ },
84
+ ENGINE_MISSING: {
85
+ code: "AX-ENGINE-001",
86
+ title: "No Engine Configured",
87
+ description: "The agent's blueprint has no engine — it cannot dispatch to a model. Set `engine` in axon.config.ts.",
88
+ source: "runtime",
89
+ severity: "fatal",
90
+ },
91
+ INJECT_OUTSIDE_RUNTIME: {
92
+ code: "AX-RUNTIME-001",
93
+ title: "Runtime Accessed Before Boot",
94
+ description: "A runtime global (axon, args) was read before the runtime finished booting.",
95
+ source: "runtime",
96
+ severity: "fatal",
97
+ },
98
+ BOOT_FAILED: {
99
+ code: "AX-BOOT-001",
100
+ title: "Agent Failed To Start",
101
+ description: "The agent's runtime crashed while starting, before it could accept requests.",
102
+ source: "runtime",
103
+ severity: "fatal",
104
+ },
105
+ BOOT_SCRIPT_FAILED: {
106
+ code: "AX-BOOT-002",
107
+ title: "Boot Script Failed",
108
+ description: "The agent's boot.vue threw while rendering — check the script setup block for the error.",
109
+ source: "runtime",
110
+ severity: "fatal",
111
+ },
112
+ BOOT_SCRIPT_INVALID: {
113
+ code: "AX-BOOT-003",
114
+ title: "Boot Script Malformed",
115
+ description: "The agent's boot.vue has content outside its recognized <script>/<template> blocks, or otherwise failed to parse as a valid SFC.",
116
+ source: "runtime",
117
+ severity: "fatal",
118
+ },
119
+
120
+ // ── Cognet (host.ts / cognet.ts) ────────────────────────────────────────
121
+ COGNET_ACCESSED_BEFORE_LOAD: {
122
+ code: "AX-COGNET-001",
123
+ title: "Cognet Accessed Before Load",
124
+ description: "A cognet global (kernel, phase, system, blueprint) was read before the brain finished loading, or outside the loop body that owns it.",
125
+ source: "cognet",
126
+ severity: "fatal",
127
+ },
128
+ COGNET_LOOP_ALREADY_DECLARED: {
129
+ code: "AX-COGNET-002",
130
+ title: "Loop Already Declared",
131
+ description: "A cognet's main() called loop() more than once — the loop is the program's entire main body and can only be declared once.",
132
+ source: "cognet",
133
+ severity: "fatal",
134
+ },
135
+ COGNET_ALREADY_LOADED: {
136
+ code: "AX-COGNET-003",
137
+ title: "Cognet Bound To A Different Kernel",
138
+ description: "This cognet instance already loaded against a different kernel ABI — a reload produced a conflicting bind instead of a clean swap.",
139
+ source: "cognet",
140
+ severity: "fatal",
141
+ },
142
+ COGNET_NO_LOOP: {
143
+ code: "AX-COGNET-004",
144
+ title: "Cognet Declared No Loop",
145
+ description: "The cognet's main() ran (or was woken) without ever declaring loop() — there is no program to run.",
146
+ source: "cognet",
147
+ severity: "fatal",
148
+ },
149
+ COGNET_MAX_TICKS: {
150
+ code: "AX-COGNET-005",
151
+ title: "Cognet Exceeded Max Ticks",
152
+ description: "The cognet's loop ran more ticks in one wake than its configured limit allows — likely a runaway loop that never calls stop().",
153
+ source: "cognet",
154
+ severity: "fatal",
155
+ },
156
+ COGNET_ABI_MISMATCH: {
157
+ code: "AX-COGNET-006",
158
+ title: "Cognet ABI Mismatch",
159
+ description: "The compiled cognet targets a kernel ABI version the running kernel doesn't provide — rebuild the cognet against the current framework version.",
160
+ source: "cognet",
161
+ severity: "fatal",
162
+ },
163
+ COGNET_MISSING: {
164
+ code: "AX-COGNET-007",
165
+ title: "No Compiled Cognet",
166
+ description: "The blueprint points at a compiled cognet bundle that doesn't exist on disk yet — run `axon prepare` before booting.",
167
+ source: "cognet",
168
+ severity: "fatal",
169
+ },
170
+ COGNET_HASH_MISMATCH: {
171
+ code: "AX-COGNET-008",
172
+ title: "Cognet Bundle Hash Mismatch",
173
+ description: "The compiled cognet bundle on disk doesn't match the hash the blueprint expects — it's stale or was tampered with. Run `axon prepare` again.",
174
+ source: "cognet",
175
+ severity: "fatal",
176
+ },
177
+ COGNET_INVALID: {
178
+ code: "AX-COGNET-009",
179
+ title: "Invalid Cognet Bundle",
180
+ description: "The compiled cognet's default export isn't a real cognet definition — the compile step produced something malformed.",
181
+ source: "cognet",
182
+ severity: "fatal",
183
+ },
184
+ COGNET_IDENTITY_MISMATCH: {
185
+ code: "AX-COGNET-010",
186
+ title: "Cognet Identity Mismatch",
187
+ description: "The compiled cognet artifact's own name doesn't match what the blueprint declared — the wrong bundle may be at this path.",
188
+ source: "cognet",
189
+ severity: "fatal",
190
+ },
191
+ COGNET_CONFIG_MISSING: {
192
+ code: "AX-COGNET-011",
193
+ title: "Cognet Config Missing",
194
+ description: "No cognet.config.ts was found in the cognet's source directory — every cognet needs one to declare its identity.",
195
+ source: "cognet",
196
+ severity: "fatal",
197
+ },
198
+ COGNET_BUILD_FAILED: {
199
+ code: "AX-COGNET-012",
200
+ title: "Cognet Failed To Compile",
201
+ description: "Bundling the cognet's source into a runnable artifact failed — check the build log for the underlying syntax or import error.",
202
+ source: "cognet",
203
+ severity: "fatal",
204
+ },
205
+ COGNET_NOT_FOUND: {
206
+ code: "AX-COGNET-013",
207
+ title: "Cognet Not Found",
208
+ description: "The cognet this agent selects isn't installed — check the `cognet` specifier in axon.config.ts and run `axon prepare` to install it from the registry.",
209
+ source: "cognet",
210
+ severity: "fatal",
211
+ },
212
+
213
+ // ── Project (build/project/dependencies.ts) ─────────────────────────────
214
+ MODULE_SPECIFIER_INVALID: {
215
+ code: "AX-PROJECT-005",
216
+ title: "Invalid Module Specifier",
217
+ description: "Module names must be scoped as @scope/name. The registry does not accept unscoped packages, so an unscoped specifier can never resolve.",
218
+ source: "manifest",
219
+ severity: "fatal",
220
+ },
221
+ CONFIG_MODULES_UNPARSEABLE: {
222
+ code: "AX-PROJECT-006",
223
+ title: "Could Not Edit axon.config.ts",
224
+ description: "The install succeeded but the module entry could not be written into the config's modules array automatically — add or remove it by hand.",
225
+ source: "manifest",
226
+ severity: "fatal",
227
+ },
228
+ MODULE_DEPENDENCY_INSTALL_FAILED: {
229
+ code: "AX-PROJECT-004",
230
+ title: "Module Dependencies Failed To Install",
231
+ description: "The module source was downloaded, but its npm dependencies could not be materialized for the agent. Resolve the package-manager error and run the install again.",
232
+ source: "manifest",
233
+ severity: "fatal",
234
+ },
235
+
236
+ // ── Blueprint (build/blueprint/blueprint.ts) ────────────────────────────
237
+ BLUEPRINT_NOT_LOADED: {
238
+ code: "AX-PROJECT-002",
239
+ title: "Blueprint Accessed Before Load",
240
+ description: "Something read the blueprint's current value before load() had ever run.",
241
+ source: "manifest",
242
+ severity: "fatal",
243
+ },
244
+ AGENT_INVALID: {
245
+ code: "AX-PROJECT-003",
246
+ title: "Invalid Agent Directory",
247
+ description: "The agent root has no package.json — every agent is a real package, this one isn't.",
248
+ source: "manifest",
249
+ severity: "fatal",
250
+ },
251
+ CORRUPT_JSON: {
252
+ code: "AX-PROJECT-004",
253
+ title: "Corrupt JSON File",
254
+ description: "A stored JSON file failed to parse — it may have been hand-edited into an invalid state, or a write was interrupted mid-flight.",
255
+ source: "manifest",
256
+ severity: "fatal",
257
+ },
258
+ PROVIDER_NOT_CONNECTED: {
259
+ code: "AX-TUI-011",
260
+ title: "Provider Not Connected",
261
+ description: "The selected model routes through a provider (OpenRouter, Codex) that isn't connected yet — connect it before picking a model on that route.",
262
+ source: "tui",
263
+ severity: "fatal",
264
+ },
265
+ PALETTE_INPUT_REQUIRED: {
266
+ code: "AX-TUI-012",
267
+ title: "Required Input Missing",
268
+ description: "A palette command needs a value for this field before it can run.",
269
+ source: "tui",
270
+ severity: "fatal",
271
+ },
272
+ BENCH_NO_CASES: {
273
+ code: "AX-TUI-013",
274
+ title: "Bench Declared No Cases",
275
+ description: "The bench's test file ran to completion under Bun but never declared a single benchmark case.",
276
+ source: "tui",
277
+ severity: "fatal",
278
+ },
279
+
280
+ // ── Project (build/project/*.ts) ────────────────────────────────────────
281
+ PROJECT_NOT_FOUND: {
282
+ code: "AX-PROJECT-005",
283
+ title: "Project Not Found",
284
+ description: "No axon.config.ts, module.config.ts, or cognet.config.ts was found at this path — it isn't a recognized project directory.",
285
+ source: "manifest",
286
+ severity: "fatal",
287
+ },
288
+ PROJECT_EXISTS: {
289
+ code: "AX-PROJECT-006",
290
+ title: "Project Already Exists",
291
+ description: "Scaffolding refused to overwrite a directory that already exists — remove it or pick a different name first.",
292
+ source: "manifest",
293
+ severity: "fatal",
294
+ },
295
+ TYPEGEN_NO_BLUEPRINT: {
296
+ code: "AX-PROJECT-007",
297
+ title: "Typegen Needs A Loaded Blueprint",
298
+ description: "Agent-kind typegen was called without a blueprint — its declared surfaces are the source of the generated types.",
299
+ source: "manifest",
300
+ severity: "fatal",
301
+ },
302
+ DEPLOY_AGENTS_ONLY: {
303
+ code: "AX-PROJECT-008",
304
+ title: "Only Agents Can Deploy",
305
+ description: "A module was asked to deploy on its own — modules only run installed inside an agent, deploy the agent instead.",
306
+ source: "manifest",
307
+ severity: "fatal",
308
+ },
309
+ PUBLISH_UNSUPPORTED_KIND: {
310
+ code: "AX-PROJECT-009",
311
+ title: "This Project Kind Cannot Publish Yet",
312
+ description: "Only agents and modules publish to the registry today. Cognets and benches become first-class registry artifacts in the unified artifact work — until then, publishing one would register it under the wrong kind and claim its name in the shared namespace.",
313
+ source: "manifest",
314
+ severity: "fatal",
315
+ },
316
+ DEPLOY_PROVISION_FAILED: {
317
+ code: "AX-PROJECT-012",
318
+ title: "Deployment Provisioning Failed",
319
+ description: "The agent was published, but the cloud control plane could not provision its runtime. The request ID identifies the server-side failure.",
320
+ source: "manifest",
321
+ severity: "fatal",
322
+ },
323
+ DEPLOY_RUNTIME_FAILED: {
324
+ code: "AX-PROJECT-013",
325
+ title: "Agent Failed To Start",
326
+ description: "Cloud infrastructure was provisioned, but the agent process failed during boot. The reported runtime diagnostic identifies the immediate cause.",
327
+ source: "runtime",
328
+ severity: "fatal",
329
+ },
330
+ DEPLOY_ENV_RESERVED: {
331
+ code: "AX-PROJECT-014",
332
+ title: "Reserved Deployment Variable",
333
+ description: "The production .env file attempts to override a variable owned by the Axon runtime or Cloud Run.",
334
+ source: "manifest",
335
+ severity: "fatal",
336
+ },
337
+ DEPLOY_ENV_INVALID: {
338
+ code: "AX-PROJECT-015",
339
+ title: "Invalid Deployment Variable",
340
+ description: "The production .env file contains a key that is not a valid environment variable name.",
341
+ source: "manifest",
342
+ severity: "fatal",
343
+ },
344
+ BUNDLE_MODULE_COLLISION: {
345
+ code: "AX-PROJECT-009",
346
+ title: "Module Name Collision",
347
+ description: "A hard-imported source module's name collides with an already-installed registry module of the same name.",
348
+ source: "manifest",
349
+ severity: "fatal",
350
+ },
351
+ BUNDLE_INVALID: {
352
+ code: "AX-PROJECT-010",
353
+ title: "Invalid Bundle Source",
354
+ description: "The directory being bundled has no package.json, or its package.json has no name — every bundle needs a real package identity.",
355
+ source: "manifest",
356
+ severity: "fatal",
357
+ },
358
+ BUNDLE_TAR_MISSING: {
359
+ code: "AX-PROJECT-011",
360
+ title: "tar Not Found",
361
+ description: "Bundling shells out to the system's tar binary, which isn't on PATH — install Git for Windows or use WSL on that platform.",
362
+ source: "manifest",
363
+ severity: "fatal",
364
+ },
365
+ BUNDLE_TAR_FAILED: {
366
+ code: "AX-PROJECT-012",
367
+ title: "tar Failed",
368
+ description: "The tar subprocess exited non-zero while building a bundle archive.",
369
+ source: "manifest",
370
+ severity: "fatal",
371
+ },
372
+
373
+ // ── Bench (build/bench/*.ts) ────────────────────────────────────────────
374
+ BENCH_RUN_NOT_FOUND: {
375
+ code: "AX-BENCH-001",
376
+ title: "Bench Run Not Found",
377
+ description: "No recorded bench run exists with this id.",
378
+ source: "bench",
379
+ severity: "fatal",
380
+ },
381
+ BENCH_NOT_FOUND: {
382
+ code: "AX-BENCH-002",
383
+ title: "Bench Not Found",
384
+ description: "No bench.config.ts was found at this path — it isn't a recognized bench project.",
385
+ source: "bench",
386
+ severity: "fatal",
387
+ },
388
+ BENCH_TESTS_NOT_FOUND: {
389
+ code: "AX-BENCH-003",
390
+ title: "Bench Test Files Not Found",
391
+ description: "The bench config declares test files that don't exist on disk.",
392
+ source: "bench",
393
+ severity: "fatal",
394
+ },
395
+ BENCH_LOCAL_REF_NOT_FOUND: {
396
+ code: "AX-BENCH-004",
397
+ title: "Bench Local Reference Not Found",
398
+ description: "A factor variable references a local file/directory that doesn't exist.",
399
+ source: "bench",
400
+ severity: "fatal",
401
+ },
402
+ BENCH_CONFIG_INVALID: {
403
+ code: "AX-BENCH-005",
404
+ title: "Bench Config Invalid",
405
+ description: "bench.config.ts failed to evaluate or didn't produce a valid bench definition.",
406
+ source: "bench",
407
+ severity: "fatal",
408
+ },
409
+ BENCH_PACKAGE_NOT_FOUND: {
410
+ code: "AX-BENCH-006",
411
+ title: "Bench Package Not Found",
412
+ description: "No package.json exists at the bench root — every bench project needs one for identity.",
413
+ source: "bench",
414
+ severity: "fatal",
415
+ },
416
+ BENCH_PACKAGE_NAME_REQUIRED: {
417
+ code: "AX-BENCH-007",
418
+ title: "Bench Package Name Required",
419
+ description: "The bench's package.json has no name field.",
420
+ source: "bench",
421
+ severity: "fatal",
422
+ },
423
+ BENCH_PACKAGE_VERSION_REQUIRED: {
424
+ code: "AX-BENCH-008",
425
+ title: "Bench Package Version Required",
426
+ description: "The bench's package.json has no version field.",
427
+ source: "bench",
428
+ severity: "fatal",
429
+ },
430
+ BENCH_CONTEXT_MISSING: {
431
+ code: "AX-BENCH-009",
432
+ title: "Bench Context Missing",
433
+ description: "The benchmark preload needs AXON_BENCH_CONTEXT set — it was run outside the bench harness.",
434
+ source: "bench",
435
+ severity: "fatal",
436
+ },
437
+ BENCH_NO_ACTIVE_CASE: {
438
+ code: "AX-BENCH-010",
439
+ title: "No Active Bench Case",
440
+ description: "A bench emission (measurement, artifact) happened outside any running Bun test — these calls must occur inside a test case.",
441
+ source: "bench",
442
+ severity: "fatal",
443
+ },
444
+ BENCH_WORKSPACE_UNAVAILABLE: {
445
+ code: "AX-BENCH-011",
446
+ title: "Bench Workspace Unavailable",
447
+ description: "The bench's workspace directory hasn't been materialized yet for this run.",
448
+ source: "bench",
449
+ severity: "fatal",
450
+ },
451
+ BENCH_AGENT_UNRESOLVED: {
452
+ code: "AX-BENCH-012",
453
+ title: "Bench Agent Unresolved",
454
+ description: "The bench's declared subject agent isn't a prepared local agent — run `axon prepare` on it first.",
455
+ source: "bench",
456
+ severity: "fatal",
457
+ },
458
+ BENCH_MEASUREMENT_UNKNOWN: {
459
+ code: "AX-BENCH-013",
460
+ title: "Unknown Bench Measurement",
461
+ description: "A measurement was emitted under an id the bench config never declared.",
462
+ source: "bench",
463
+ severity: "fatal",
464
+ },
465
+ BENCH_MEASUREMENT_TYPE: {
466
+ code: "AX-BENCH-014",
467
+ title: "Bench Measurement Type Mismatch",
468
+ description: "A measurement's emitted value doesn't match the type its bench config declaration expects.",
469
+ source: "bench",
470
+ severity: "fatal",
471
+ },
472
+ BENCH_MEASUREMENT_DOMAIN: {
473
+ code: "AX-BENCH-015",
474
+ title: "Bench Measurement Out Of Domain",
475
+ description: "A measurement's emitted value falls outside the range or category the bench config declares for it.",
476
+ source: "bench",
477
+ severity: "fatal",
478
+ },
479
+ BENCH_DIMENSION_UNKNOWN: {
480
+ code: "AX-BENCH-016",
481
+ title: "Unknown Bench Dimension",
482
+ description: "A dimension value was set under an id the bench config never declared.",
483
+ source: "bench",
484
+ severity: "fatal",
485
+ },
486
+ BENCH_DIMENSION_DOMAIN: {
487
+ code: "AX-BENCH-017",
488
+ title: "Bench Dimension Out Of Domain",
489
+ description: "A dimension's set value isn't one of the categories its bench config declares.",
490
+ source: "bench",
491
+ severity: "fatal",
492
+ },
493
+ BENCH_FACTOR_UNKNOWN: {
494
+ code: "AX-BENCH-018",
495
+ title: "Unknown Bench Factor",
496
+ description: "Something referenced a factor id the running bench's coordinate never assigned a value to.",
497
+ source: "bench",
498
+ severity: "fatal",
499
+ },
500
+ BENCH_ARTIFACT_UNKNOWN: {
501
+ code: "AX-BENCH-019",
502
+ title: "Unknown Bench Artifact",
503
+ description: "An artifact was emitted under an id the bench config never declared.",
504
+ source: "bench",
505
+ severity: "fatal",
506
+ },
507
+ BENCH_ARTIFACT_MEDIA_TYPE: {
508
+ code: "AX-BENCH-020",
509
+ title: "Bench Artifact Media Type Not Allowed",
510
+ description: "An artifact was emitted with a media type its bench config declaration doesn't allow.",
511
+ source: "bench",
512
+ severity: "fatal",
513
+ },
514
+ BENCH_FACTOR_NOT_FOUND: {
515
+ code: "AX-BENCH-021",
516
+ title: "Bench Factor Not Found",
517
+ description: "The bench config has no factor with this id.",
518
+ source: "bench",
519
+ severity: "fatal",
520
+ },
521
+ BENCH_FACTOR_VALUE_NOT_FOUND: {
522
+ code: "AX-BENCH-022",
523
+ title: "Bench Factor Value Not Found",
524
+ description: "The bench config's factor has no declared value with this id.",
525
+ source: "bench",
526
+ severity: "fatal",
527
+ },
528
+ BENCH_TEMPLATE_ESCAPE: {
529
+ code: "AX-BENCH-023",
530
+ title: "Bench Template Path Escapes Root",
531
+ description: "A workspace template entry resolved to a path outside the template directory — refused rather than materialized.",
532
+ source: "bench",
533
+ severity: "fatal",
534
+ },
535
+ BENCH_TEMPLATE_SYMLINK_UNSUPPORTED: {
536
+ code: "AX-BENCH-024",
537
+ title: "Bench Template Symlinks Unsupported",
538
+ description: "A workspace template contains a symlink — not supported when materializing a bench workspace.",
539
+ source: "bench",
540
+ severity: "fatal",
541
+ },
542
+ BENCH_TEMPLATE_OUTSIDE_ROOT: {
543
+ code: "AX-BENCH-025",
544
+ title: "Bench Template Outside Root",
545
+ description: "A workspace template's declared source path resolves outside the bench project root.",
546
+ source: "bench",
547
+ severity: "fatal",
548
+ },
549
+ BENCH_TEMPLATE_NOT_FOUND: {
550
+ code: "AX-BENCH-026",
551
+ title: "Bench Template Not Found",
552
+ description: "A workspace template's declared source path isn't a real directory.",
553
+ source: "bench",
554
+ severity: "fatal",
555
+ },
556
+ BENCH_LOG_INVALID: {
557
+ code: "AX-BENCH-027",
558
+ title: "Bench Log Invalid",
559
+ description: "A bench run's event log is missing an entry its projection requires — the log is incomplete or was written out of order.",
560
+ source: "bench",
561
+ severity: "fatal",
562
+ },
563
+
564
+ // ── Blueprint scan (scan/tools.ts, scan/config.ts) ──────────────────────
565
+ TOOL_DECLARE_FAILED: {
566
+ code: "AX-BLUEPRINT-002",
567
+ title: "Tool Declaration Failed",
568
+ description: "Compiling a src/tools/*.ts file's TypeScript declarations failed — the worker subprocess reported a compile error.",
569
+ source: "manifest",
570
+ severity: "fatal",
571
+ },
572
+ TOOL_BUNDLE_FAILED: {
573
+ code: "AX-BLUEPRINT-006",
574
+ title: "Tool Bundle Failed",
575
+ description: "Bundling a src/tools/*.ts file to self-contained source failed — the bundler subprocess reported an error. Tools are bundled so the sandbox loads them without mounting the project; a bundle failure means the tool cannot enter the box.",
576
+ source: "manifest",
577
+ severity: "fatal",
578
+ },
579
+ CONFIG_NOT_FOUND: {
580
+ code: "AX-BLUEPRINT-003",
581
+ title: "Config Not Found",
582
+ description: "No axon.config.ts exists at this path.",
583
+ source: "manifest",
584
+ severity: "fatal",
585
+ },
586
+ CONFIG_LOAD_FAILED: {
587
+ code: "AX-BLUEPRINT-004",
588
+ title: "Config Failed To Load",
589
+ description: "axon.config.ts threw or failed to evaluate — check the file for a syntax or runtime error.",
590
+ source: "manifest",
591
+ severity: "fatal",
592
+ },
593
+ CONFIG_INVALID: {
594
+ code: "AX-BLUEPRINT-005",
595
+ title: "Config Invalid",
596
+ description: "axon.config.ts evaluated but never called defineAgent() — every agent config must produce one.",
597
+ source: "manifest",
598
+ severity: "fatal",
599
+ },
600
+
601
+ // ── Kernel (engine.ts / executor.ts) ─────────────────────────────────────
602
+ ENGINE_NO_DONE: {
603
+ code: "AX-KERNEL-001",
604
+ title: "Engine Stream Ended Without Completing",
605
+ description: "The model driver's stream ended without ever emitting a completion event — the engine likely disconnected or crashed mid-response.",
606
+ source: "kernel",
607
+ severity: "fatal",
608
+ },
609
+ ENGINE_STREAM_FAILED: {
610
+ code: "AX-KERNEL-008",
611
+ title: "Engine Stream Failed",
612
+ description: "The model driver's stream failed and exhausted its retries (or the failure wasn't retryable) — see context for the provider's fault code.",
613
+ source: "kernel",
614
+ severity: "fatal",
615
+ },
616
+ CODEX_NOT_CONNECTED: {
617
+ code: "AX-KERNEL-012",
618
+ title: "Codex Subscription Not Connected",
619
+ description: "This agent uses a Codex model, but your Axon account is not connected to ChatGPT — run :provider codex connect and try again.",
620
+ source: "kernel",
621
+ severity: "fatal",
622
+ },
623
+ RUN_IN_PROGRESS: {
624
+ code: "AX-KERNEL-002",
625
+ title: "A Wake Is Already Running",
626
+ description: "The kernel only executes one wake at a time — a new run was requested while the previous one was still active.",
627
+ source: "kernel",
628
+ severity: "recovered",
629
+ },
630
+ RUN_RESERVATION_EXPIRED: {
631
+ code: "AX-KERNEL-003",
632
+ title: "Wake Reservation Expired",
633
+ description: "The reserved execution slot for this wake is no longer active — it was released before the run could start.",
634
+ source: "kernel",
635
+ severity: "fatal",
636
+ },
637
+ NO_COGNET_LOADED: {
638
+ code: "AX-KERNEL-004",
639
+ title: "No Cognet Loaded",
640
+ description: "The kernel tried to execute a wake, but the blueprint carried no cognet definition to run it against.",
641
+ source: "kernel",
642
+ severity: "fatal",
643
+ },
644
+ SYSCALL_OUTSIDE_RUN: {
645
+ code: "AX-KERNEL-005",
646
+ title: "Syscall Outside An Active Run",
647
+ description: "A kernel syscall (engine.stream and similar) was made with no active wake to attribute it to.",
648
+ source: "kernel",
649
+ severity: "fatal",
650
+ },
651
+ CAPSULE_ACCESSED_BEFORE_BOOT: {
652
+ code: "AX-KERNEL-007",
653
+ title: "Capsule Accessed Before Boot",
654
+ description: "Something reached for the live capsule instance before boot() had run — there is no sandbox yet to hand back.",
655
+ source: "kernel",
656
+ severity: "fatal",
657
+ },
658
+ COGNET_EMIT_FORBIDDEN: {
659
+ code: "AX-KERNEL-009",
660
+ title: "Cognet Emit Forbidden",
661
+ description: "A cognet tried to emit an event outside the cognet:* namespace — the ABI only lets a cognet narrate its own telemetry, never forge kernel machinery events.",
662
+ source: "kernel",
663
+ severity: "fatal",
664
+ },
665
+ SCHEDULER_MODE_MISMATCH: {
666
+ code: "AX-KERNEL-010",
667
+ title: "Scheduler Mode Mismatch",
668
+ description: "A caller invoked stream() on a continuous-mode cognet — continuous cognets are invoked by the scheduler's own clock, never by an external stimulus-driven call.",
669
+ source: "kernel",
670
+ severity: "fatal",
671
+ },
672
+ SCHEDULER_CONTINUOUS_NOT_IMPLEMENTED: {
673
+ code: "AX-KERNEL-011",
674
+ title: "Continuous Scheduling Not Implemented",
675
+ description: "The cognet declared continuous mode, but the scheduler's clock-driven trigger is a stubbed shape only — no cognet may select it yet.",
676
+ source: "kernel",
677
+ severity: "fatal",
678
+ },
679
+
680
+ // ── Session (session.ts) ─────────────────────────────────────────────────
681
+ THREAD_UNKNOWN_PARENT: {
682
+ code: "AX-SESSION-001",
683
+ title: "Thread Branched From Unknown Parent",
684
+ description: "A thread's recorded lineage points at a parent thread id that isn't registered in this session — the session index is inconsistent.",
685
+ source: "thread",
686
+ severity: "fatal",
687
+ },
688
+ THREAD_NOT_FOUND: {
689
+ code: "AX-SESSION-002",
690
+ title: "Thread Not Found",
691
+ description: "The requested thread id isn't registered in this session.",
692
+ source: "thread",
693
+ severity: "fatal",
694
+ },
695
+ THREAD_BRANCH_UNKNOWN: {
696
+ code: "AX-SESSION-003",
697
+ title: "Cannot Branch Unknown Thread",
698
+ description: "A branch was requested from a parent thread id that isn't registered in this session.",
699
+ source: "thread",
700
+ severity: "fatal",
701
+ },
702
+
703
+ // ── Blueprint ─────────────────────────────────────────────────────────────
704
+ NO_COGNET: {
705
+ code: "AX-BLUEPRINT-001",
706
+ title: "No Cognet Declared",
707
+ description: "The blueprint carries no cognet definition — an agent cannot run without a brain. The CLI or test harness must construct and pass one.",
708
+ source: "runtime",
709
+ severity: "fatal",
710
+ },
711
+
712
+ // ── Server ────────────────────────────────────────────────────────────────
713
+ PLUGIN_BOOT_FAILED: {
714
+ code: "AX-SERVER-001",
715
+ title: "Plugin Failed During Boot",
716
+ description: "A server plugin threw while running at boot — plugins are the one place in server startup where a failure must abort the boot rather than being warned and skipped.",
717
+ source: "server",
718
+ severity: "fatal",
719
+ },
720
+ HANDLE_SHUTDOWN_FAILED: {
721
+ code: "AX-RUNTIME-002",
722
+ title: "Handle Failed To Shut Down",
723
+ description: "One of the runtime's owned handles (kernel, etc.) threw during shutdown — teardown is error-isolated, so the others still ran, but this one didn't close cleanly.",
724
+ source: "runtime",
725
+ severity: "fatal",
726
+ },
727
+ TOOL_CALL_FAILED: {
728
+ code: "AX-RUNTIME-003",
729
+ title: "Tool Call Failed",
730
+ description: "An axon.tools.<namespace>.<fn>() call from script-land completed with a non-ok result from the capsule — unwrapped here into a normal throw, since script-land expects the ordinary call/throw contract, not the kernel's own stable-result shape.",
731
+ source: "runtime",
732
+ severity: "fatal",
733
+ },
734
+
735
+ // ── Capsule (build/tools.ts) ─────────────────────────────────────────────
736
+ CAPSULE_TOOL_TIMEOUT: {
737
+ code: "AX-CAPSULE-001",
738
+ title: "Tool Load Timed Out",
739
+ description: "The sandbox never confirmed loading a declared tool within the timeout — it may be stuck on a slow import or the subprocess is unresponsive.",
740
+ source: "capsule",
741
+ severity: "fatal",
742
+ },
743
+ CAPSULE_TOOL_SCOPE_MISMATCH: {
744
+ code: "AX-CAPSULE-002",
745
+ title: "Tool Scope Mismatch",
746
+ description: "A tool's declared exports don't match what it actually exported once loaded in the sandbox — the bundled source and its declaration have drifted apart.",
747
+ source: "capsule",
748
+ severity: "fatal",
749
+ },
750
+ CAPSULE_TOOL_FAILED: {
751
+ code: "AX-CAPSULE-003",
752
+ title: "Tool Failed To Load",
753
+ description: "A declared tool failed to load into the sandbox — its source may be malformed, too large to import, or the subprocess exited before confirming.",
754
+ source: "capsule",
755
+ severity: "fatal",
756
+ },
757
+ CAPSULE_CONFINE_UNAVAILABLE: {
758
+ code: "AX-CAPSULE-004",
759
+ title: "OS Confinement Unavailable",
760
+ description: "The policy requested OS confinement (isolation: auto) but the host is missing a required primitive (bubblewrap, systemd, nft, or the axon-agent user). Run `axon install`, or set isolation: none to opt out explicitly. The capsule refuses to boot rather than silently run unconfined.",
761
+ source: "capsule",
762
+ severity: "fatal",
763
+ },
764
+ CAPSULE_CONFINE_USER_UNRESOLVED: {
765
+ code: "AX-CAPSULE-005",
766
+ title: "Confinement User Unresolved",
767
+ description: "The confinement user exists but its numeric uid/gid could not be read — the box cannot drop privileges without them. The host user database may be inconsistent.",
768
+ source: "capsule",
769
+ severity: "fatal",
770
+ },
771
+ CAPSULE_BOOT_FAILED: {
772
+ code: "AX-CAPSULE-006",
773
+ title: "Capsule Failed To Boot",
774
+ description: "The sandbox subprocess exited or reported failure before completing the boot handshake. The captured stderr in the error context is the real cause — most often a confinement mount that could not be satisfied (a declared fs path that does not exist) or a runtime that could not start.",
775
+ source: "capsule",
776
+ severity: "fatal",
777
+ },
778
+ CAPSULE_BOOT_TIMEOUT: {
779
+ code: "AX-CAPSULE-007",
780
+ title: "Capsule Boot Timed Out",
781
+ description: "The sandbox subprocess did not report ready within the boot timeout. Its captured stderr is in the error context; if empty, the subprocess may be hung rather than crashed.",
782
+ source: "capsule",
783
+ severity: "fatal",
784
+ },
785
+ CAPSULE_SPAWN_FAILED: {
786
+ code: "AX-CAPSULE-008",
787
+ title: "Capsule Spawn Failed",
788
+ description: "The capsule subprocess command could not be spawned at all — the interpreter or confinement wrapper was not found, or PATH is unset. Check that bun (and, under confinement, bwrap/systemd-run) are on PATH.",
789
+ source: "capsule",
790
+ severity: "fatal",
791
+ },
792
+ CAPSULE_WIRE_CLOSED: {
793
+ code: "AX-CAPSULE-009",
794
+ title: "Capsule Wire Closed",
795
+ description: "A command was sent to the sandbox after its stdin pipe was gone — the subprocess has exited or is mid-teardown. The caller is racing the capsule lifecycle.",
796
+ source: "capsule",
797
+ severity: "fatal",
798
+ },
799
+ CAPSULE_DOWN: {
800
+ code: "AX-CAPSULE-010",
801
+ title: "No Live Capsule",
802
+ description: "An operation needed a running sandbox subprocess, but none is live — it is booting, restarting after a crash, or has been declared dead.",
803
+ source: "capsule",
804
+ severity: "fatal",
805
+ },
806
+ CAPSULE_ALREADY_BOOTED: {
807
+ code: "AX-CAPSULE-011",
808
+ title: "Capsule Already Booted",
809
+ description: "boot() was called on a capsule that already has a live subprocess. Boot is once per lifetime; use update()/reload() to replace a running incarnation.",
810
+ source: "capsule",
811
+ severity: "fatal",
812
+ },
813
+ CAPSULE_INSTALL_FAILED: {
814
+ code: "AX-CAPSULE-013",
815
+ title: "Confinement Install Failed",
816
+ description: "Provisioning the host for the hardened confinement tier failed — most often because creating the dedicated system user needs root. Re-run `axon install` with sufficient privilege.",
817
+ source: "capsule",
818
+ severity: "fatal",
819
+ },
820
+ CAPSULE_HOST_UNAVAILABLE: {
821
+ code: "AX-CAPSULE-014",
822
+ title: "Host Bridge Unavailable",
823
+ description: "Sandboxed code called a host service, but this capsule was built with no host provider. Host calls require a wired host bridge on the manager side.",
824
+ source: "capsule",
825
+ severity: "fatal",
826
+ },
827
+
828
+ // ── TUI (useAgents.ts / platform/build/agent / platform/store / platform/services/cloud) ──
829
+ NOT_BOOTED: {
830
+ code: "AX-TUI-001",
831
+ title: "No Agent Running",
832
+ description: "A message was sent, or an action requiring a live agent was taken, before any agent finished booting.",
833
+ source: "tui",
834
+ severity: "fatal",
835
+ },
836
+ NOT_AUTHENTICATED: {
837
+ code: "AX-TUI-002",
838
+ title: "Not Logged In",
839
+ description: "The action needs an active profile, but none is logged in yet.",
840
+ source: "tui",
841
+ severity: "fatal",
842
+ },
843
+ PROFILE_NOT_AUTHENTICATED: {
844
+ code: "AX-TUI-003",
845
+ title: "Profile Has No Session",
846
+ description: "The target profile exists but has no stored session — it has never logged in, or its session was cleared.",
847
+ source: "tui",
848
+ severity: "fatal",
849
+ },
850
+ PROFILE_UNKNOWN: {
851
+ code: "AX-TUI-004",
852
+ title: "Unknown Profile",
853
+ description: "The requested profile id isn't one of the profiles stored on this machine.",
854
+ source: "tui",
855
+ severity: "fatal",
856
+ },
857
+ SESSION_ALREADY_RUNNING: {
858
+ code: "AX-TUI-005",
859
+ title: "Session Is Already Running",
860
+ description: "spawn() was asked to resume a session that already has a live instance. Focus the running instance instead of booting a second runtime over the same log.",
861
+ source: "tui",
862
+ severity: "fatal",
863
+ },
864
+ SESSION_NOT_RUNNING: {
865
+ code: "AX-TUI-016",
866
+ title: "Session Is Not Running",
867
+ description: "focus() was pointed at a sessionId with no live instance behind it. Spawn (or resume) it first — focus is pure selection over running instances.",
868
+ source: "tui",
869
+ severity: "fatal",
870
+ },
871
+ NO_FOCUSED_INSTANCE: {
872
+ code: "AX-TUI-017",
873
+ title: "No Focused Agent Instance",
874
+ description: "A module install/uninstall was requested with no running agent instance focused — spawn or focus one first.",
875
+ source: "tui",
876
+ severity: "fatal",
877
+ },
878
+ MODULE_INSTALL_FAILED: {
879
+ code: "AX-TUI-018",
880
+ title: "Module Install Failed",
881
+ description: "The registry installer returned an error for this module specifier — check the specifier and registry connectivity.",
882
+ source: "tui",
883
+ severity: "fatal",
884
+ },
885
+ NO_MODULES_INSTALLED: {
886
+ code: "AX-TUI-019",
887
+ title: "No Modules Installed",
888
+ description: "The :uninstall command was opened with no modules resolved into the focused instance's blueprint.",
889
+ source: "tui",
890
+ severity: "fatal",
891
+ },
892
+ BASE_UNMANAGED: {
893
+ code: "AX-TUI-006",
894
+ title: "Base Config Not Platform-Managed",
895
+ description: "The managed base workspace's config exists on disk but carries no platform manifest — it wasn't created by the platform and won't be overwritten automatically.",
896
+ source: "tui",
897
+ severity: "fatal",
898
+ },
899
+ BASE_CONFIG_MODIFIED: {
900
+ code: "AX-TUI-007",
901
+ title: "Base Config Edited By Hand",
902
+ description: "The managed base workspace's config no longer matches the hash the platform recorded — someone edited it directly, so the platform refuses to overwrite it.",
903
+ source: "tui",
904
+ severity: "fatal",
905
+ },
906
+ DEPLOYMENT_NOT_CONNECTABLE: {
907
+ code: "AX-TUI-028",
908
+ title: "Deployment Not Connectable",
909
+ description: "The deployment is not in the connectable list — it may have stopped, errored, or never finished provisioning. Refresh the deployment list and try again.",
910
+ source: "tui",
911
+ severity: "fatal",
912
+ },
913
+ SUBAGENT_REMOTE_PARENT: {
914
+ code: "AX-TUI-027",
915
+ title: "Cannot Spawn A Subagent From A Deployment",
916
+ description: "A subagent is forked from its parent's local project, and an attached deployment has no local project here — the deployed agent runs its own subagents inside its own capsule.",
917
+ source: "tui",
918
+ severity: "fatal",
919
+ },
920
+ BASE_MODEL_INSTANCE_CONFLICT: {
921
+ code: "AX-TUI-026",
922
+ title: "Managed Model Instance Already Running",
923
+ description: "A managed base instance is already running on a different engine. The base workspace holds one shared config, so spawning a second naked model would rewrite it underneath the live instance — close the running one first.",
924
+ source: "tui",
925
+ severity: "fatal",
926
+ },
927
+ NOT_WIRED: {
928
+ code: "AX-TUI-008",
929
+ title: "Not Wired Yet",
930
+ description: "This surface is a declared stub — the real implementation hasn't been built yet.",
931
+ source: "tui",
932
+ severity: "fatal",
933
+ },
934
+ MIC_ALREADY_CAPTURING: {
935
+ code: "AX-TUI-009",
936
+ title: "Mic Already Capturing",
937
+ description: "capture.start() was called while a capture was already in progress — stop the current one first.",
938
+ source: "tui",
939
+ severity: "fatal",
940
+ },
941
+ MIC_CAPTURE_UNAVAILABLE: {
942
+ code: "AX-TUI-010",
943
+ title: "No Audio Capture Tool Found",
944
+ description: "Voice input needs one of arecord, sox, or ffmpeg installed and on PATH.",
945
+ source: "tui",
946
+ severity: "fatal",
947
+ },
948
+ MIC_FFT_SIZE_MISMATCH: {
949
+ code: "AX-TUI-014",
950
+ title: "FFT Sample Size Mismatch",
951
+ description: "computeBuckets() was called with a sample buffer that isn't exactly config.fftSize long — an internal invariant, callers must pad/trim first.",
952
+ source: "tui",
953
+ severity: "fatal",
954
+ },
955
+ MIC_CAPTURE_FAILED: {
956
+ code: "AX-TUI-015",
957
+ title: "Mic Capture Failed",
958
+ description: "The audio capture subprocess produced no output or exited immediately — check that a microphone is available.",
959
+ source: "tui",
960
+ severity: "fatal",
961
+ },
962
+ WATCH_PATH_REQUIRED: {
963
+ code: "AX-TUI-021",
964
+ title: "Watch Path Required",
965
+ description: "`axon watch`/`axon unwatch` need a directory argument.",
966
+ source: "tui",
967
+ severity: "fatal",
968
+ },
969
+ WATCH_PATH_NOT_FOUND: {
970
+ code: "AX-TUI-022",
971
+ title: "Watch Path Not Found",
972
+ description: "`axon watch` was given a directory that doesn't exist on disk.",
973
+ source: "tui",
974
+ severity: "fatal",
975
+ },
976
+ EDITOR_NOT_SET: {
977
+ code: "AX-TUI-023",
978
+ title: "No Editor Configured",
979
+ description: "`axon settings` needs the $EDITOR environment variable set to know which editor to open.",
980
+ source: "tui",
981
+ severity: "fatal",
982
+ },
983
+ EDITOR_LAUNCH_FAILED: {
984
+ code: "AX-TUI-024",
985
+ title: "Editor Failed To Launch",
986
+ description: "The command in $EDITOR could not be spawned — check that it's installed and on PATH.",
987
+ source: "tui",
988
+ severity: "fatal",
989
+ },
990
+ WATCH_AND_INIT_ARGS_REQUIRED: {
991
+ code: "AX-TUI-025",
992
+ title: "Directory And Name Required",
993
+ description: "The init palette's \"watch a new directory\" entry needs both a directory path and an agent name, space-separated.",
994
+ source: "tui",
995
+ severity: "fatal",
996
+ },
997
+
998
+ // ── Module boot-time execution (core runs defineModule setup) ────────────
999
+ MODULE_CONFIG_LOAD_FAILED: {
1000
+ code: "AX-MODULE-001",
1001
+ title: "Module Config Failed To Load",
1002
+ description: "The runtime could not import a module's module.config.ts at boot — the file is missing at its resolved path, or importing it threw. A module that cannot load contributes nothing, so boot fails rather than run a partially-wired agent.",
1003
+ source: "runtime",
1004
+ severity: "fatal",
1005
+ },
1006
+ MODULE_OPTIONS_INVALID: {
1007
+ code: "AX-MODULE-002",
1008
+ title: "Invalid Module Options",
1009
+ description: "The options declared for a module under modules.<name> in axon.config.ts do not satisfy the module's options schema — a required option is missing or a value has the wrong type.",
1010
+ source: "runtime",
1011
+ severity: "fatal",
1012
+ },
1013
+ MODULE_SETUP_FAILED: {
1014
+ code: "AX-MODULE-003",
1015
+ title: "Module Setup Failed",
1016
+ description: "A module's setup() threw during agent boot. Setup runs sequentially in blueprint order and a failure is total — no later module is wired, and the agent does not boot half-configured.",
1017
+ source: "runtime",
1018
+ severity: "fatal",
1019
+ },
1020
+ MODULE_SERVER_NOT_WIRED: {
1021
+ code: "AX-MODULE-004",
1022
+ title: "Module Server API Not Wired",
1023
+ description: "A module's setup() called ctx.server.addRoute/addMiddleware or ctx.tools.get, but that surface is not implemented yet. Declare routes as server/api/ files in the module instead.",
1024
+ source: "runtime",
1025
+ severity: "fatal",
1026
+ },
1027
+ MODULE_ENV_REQUIRED: {
1028
+ code: "AX-MODULE-005",
1029
+ title: "Module Env Var Missing",
1030
+ description: "A module's setup() called ctx.env.require() for a variable the agent's resolved environment does not provide. The module declares required env in module.config.ts; the agent must supply it (e.g. in .env).",
1031
+ source: "runtime",
1032
+ severity: "fatal",
1033
+ },
1034
+ MODULE_POLICY_IMMUTABLE: {
1035
+ code: "AX-MODULE-006",
1036
+ title: "Module Policy Is Immutable At Boot",
1037
+ description: "A module's setup() called ctx.policy.update(). The resolved agent policy is authoritative and cannot be mutated at boot — declare policy needs statically in module.config.ts so the CLI reconciles them at install.",
1038
+ source: "runtime",
1039
+ severity: "fatal",
1040
+ },
1041
+ } as const satisfies Record<string, AxonErrorMapEntry>
1042
+
1043
+ export type AxonErrorMap = typeof errorMap
1044
+ export type AxonErrorCode = keyof AxonErrorMap