@cleocode/mcp-server 0.86.0
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/LICENSE +21 -0
- package/README.md +306 -0
- package/dist/domains/index.d.ts +16 -0
- package/dist/domains/index.d.ts.map +1 -0
- package/dist/domains/index.js +16 -0
- package/dist/domains/index.js.map +1 -0
- package/dist/domains/lifecycle.d.ts +147 -0
- package/dist/domains/lifecycle.d.ts.map +1 -0
- package/dist/domains/lifecycle.js +452 -0
- package/dist/domains/lifecycle.js.map +1 -0
- package/dist/domains/orchestrate.d.ts +133 -0
- package/dist/domains/orchestrate.d.ts.map +1 -0
- package/dist/domains/orchestrate.js +465 -0
- package/dist/domains/orchestrate.js.map +1 -0
- package/dist/domains/release.d.ts +109 -0
- package/dist/domains/release.d.ts.map +1 -0
- package/dist/domains/release.js +400 -0
- package/dist/domains/release.js.map +1 -0
- package/dist/domains/research.d.ts +139 -0
- package/dist/domains/research.d.ts.map +1 -0
- package/dist/domains/research.js +606 -0
- package/dist/domains/research.js.map +1 -0
- package/dist/domains/session.d.ts +129 -0
- package/dist/domains/session.d.ts.map +1 -0
- package/dist/domains/session.js +433 -0
- package/dist/domains/session.js.map +1 -0
- package/dist/domains/system.d.ts +92 -0
- package/dist/domains/system.d.ts.map +1 -0
- package/dist/domains/system.js +473 -0
- package/dist/domains/system.js.map +1 -0
- package/dist/domains/tasks.d.ts +180 -0
- package/dist/domains/tasks.d.ts.map +1 -0
- package/dist/domains/tasks.js +704 -0
- package/dist/domains/tasks.js.map +1 -0
- package/dist/domains/validate.d.ts +150 -0
- package/dist/domains/validate.d.ts.map +1 -0
- package/dist/domains/validate.js +568 -0
- package/dist/domains/validate.js.map +1 -0
- package/dist/gateways/mutate.d.ts +100 -0
- package/dist/gateways/mutate.d.ts.map +1 -0
- package/dist/gateways/mutate.js +937 -0
- package/dist/gateways/mutate.js.map +1 -0
- package/dist/gateways/query.d.ts +91 -0
- package/dist/gateways/query.d.ts.map +1 -0
- package/dist/gateways/query.js +245 -0
- package/dist/gateways/query.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +299 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/audit.d.ts +118 -0
- package/dist/lib/audit.d.ts.map +1 -0
- package/dist/lib/audit.js +311 -0
- package/dist/lib/audit.js.map +1 -0
- package/dist/lib/background-jobs.d.ts +86 -0
- package/dist/lib/background-jobs.d.ts.map +1 -0
- package/dist/lib/background-jobs.js +183 -0
- package/dist/lib/background-jobs.js.map +1 -0
- package/dist/lib/cache.d.ts +78 -0
- package/dist/lib/cache.d.ts.map +1 -0
- package/dist/lib/cache.js +204 -0
- package/dist/lib/cache.js.map +1 -0
- package/dist/lib/command-builder.d.ts +52 -0
- package/dist/lib/command-builder.d.ts.map +1 -0
- package/dist/lib/command-builder.js +280 -0
- package/dist/lib/command-builder.js.map +1 -0
- package/dist/lib/config.d.ts +42 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +248 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/defaults.d.ts +115 -0
- package/dist/lib/defaults.d.ts.map +1 -0
- package/dist/lib/defaults.js +61 -0
- package/dist/lib/defaults.js.map +1 -0
- package/dist/lib/error-handler.d.ts +101 -0
- package/dist/lib/error-handler.d.ts.map +1 -0
- package/dist/lib/error-handler.js +277 -0
- package/dist/lib/error-handler.js.map +1 -0
- package/dist/lib/executor.d.ts +110 -0
- package/dist/lib/executor.d.ts.map +1 -0
- package/dist/lib/executor.js +362 -0
- package/dist/lib/executor.js.map +1 -0
- package/dist/lib/exit-codes.d.ts +190 -0
- package/dist/lib/exit-codes.d.ts.map +1 -0
- package/dist/lib/exit-codes.js +1027 -0
- package/dist/lib/exit-codes.js.map +1 -0
- package/dist/lib/formatter.d.ts +196 -0
- package/dist/lib/formatter.d.ts.map +1 -0
- package/dist/lib/formatter.js +260 -0
- package/dist/lib/formatter.js.map +1 -0
- package/dist/lib/gate-validators.d.ts +103 -0
- package/dist/lib/gate-validators.d.ts.map +1 -0
- package/dist/lib/gate-validators.js +689 -0
- package/dist/lib/gate-validators.js.map +1 -0
- package/dist/lib/manifest-parser.d.ts +61 -0
- package/dist/lib/manifest-parser.d.ts.map +1 -0
- package/dist/lib/manifest-parser.js +338 -0
- package/dist/lib/manifest-parser.js.map +1 -0
- package/dist/lib/manifest.d.ts +177 -0
- package/dist/lib/manifest.d.ts.map +1 -0
- package/dist/lib/manifest.js +301 -0
- package/dist/lib/manifest.js.map +1 -0
- package/dist/lib/protocol-enforcement.d.ts +105 -0
- package/dist/lib/protocol-enforcement.d.ts.map +1 -0
- package/dist/lib/protocol-enforcement.js +331 -0
- package/dist/lib/protocol-enforcement.js.map +1 -0
- package/dist/lib/protocol-rules.d.ts +55 -0
- package/dist/lib/protocol-rules.d.ts.map +1 -0
- package/dist/lib/protocol-rules.js +760 -0
- package/dist/lib/protocol-rules.js.map +1 -0
- package/dist/lib/rate-limiter.d.ts +110 -0
- package/dist/lib/rate-limiter.d.ts.map +1 -0
- package/dist/lib/rate-limiter.js +208 -0
- package/dist/lib/rate-limiter.js.map +1 -0
- package/dist/lib/router.d.ts +126 -0
- package/dist/lib/router.d.ts.map +1 -0
- package/dist/lib/router.js +276 -0
- package/dist/lib/router.js.map +1 -0
- package/dist/lib/schema.d.ts +55 -0
- package/dist/lib/schema.d.ts.map +1 -0
- package/dist/lib/schema.js +70 -0
- package/dist/lib/schema.js.map +1 -0
- package/dist/lib/security.d.ts +156 -0
- package/dist/lib/security.d.ts.map +1 -0
- package/dist/lib/security.js +347 -0
- package/dist/lib/security.js.map +1 -0
- package/dist/lib/verification-gates.d.ts +287 -0
- package/dist/lib/verification-gates.d.ts.map +1 -0
- package/dist/lib/verification-gates.js +548 -0
- package/dist/lib/verification-gates.js.map +1 -0
- package/dist/types/domain.d.ts +29 -0
- package/dist/types/domain.d.ts.map +1 -0
- package/dist/types/domain.js +7 -0
- package/dist/types/domain.js.map +1 -0
- package/dist/types/error.d.ts +101 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/error.js +61 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/gateway.d.ts +78 -0
- package/dist/types/gateway.d.ts.map +1 -0
- package/dist/types/gateway.js +7 -0
- package/dist/types/gateway.js.map +1 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/operations/lifecycle.d.ts +140 -0
- package/dist/types/operations/lifecycle.d.ts.map +1 -0
- package/dist/types/operations/lifecycle.js +8 -0
- package/dist/types/operations/lifecycle.js.map +1 -0
- package/dist/types/operations/orchestrate.d.ts +140 -0
- package/dist/types/operations/orchestrate.d.ts.map +1 -0
- package/dist/types/operations/orchestrate.js +8 -0
- package/dist/types/operations/orchestrate.js.map +1 -0
- package/dist/types/operations/release.d.ts +97 -0
- package/dist/types/operations/release.d.ts.map +1 -0
- package/dist/types/operations/release.js +7 -0
- package/dist/types/operations/release.js.map +1 -0
- package/dist/types/operations/research.d.ts +122 -0
- package/dist/types/operations/research.d.ts.map +1 -0
- package/dist/types/operations/research.js +8 -0
- package/dist/types/operations/research.js.map +1 -0
- package/dist/types/operations/session.d.ts +108 -0
- package/dist/types/operations/session.d.ts.map +1 -0
- package/dist/types/operations/session.js +8 -0
- package/dist/types/operations/session.js.map +1 -0
- package/dist/types/operations/system.d.ts +147 -0
- package/dist/types/operations/system.d.ts.map +1 -0
- package/dist/types/operations/system.js +8 -0
- package/dist/types/operations/system.js.map +1 -0
- package/dist/types/operations/tasks.d.ts +186 -0
- package/dist/types/operations/tasks.d.ts.map +1 -0
- package/dist/types/operations/tasks.js +8 -0
- package/dist/types/operations/tasks.js.map +1 -0
- package/dist/types/operations/validate.d.ts +170 -0
- package/dist/types/operations/validate.d.ts.map +1 -0
- package/dist/types/operations/validate.js +8 -0
- package/dist/types/operations/validate.js.map +1 -0
- package/package.json +67 -0
- package/schemas/IMPLEMENTATION-SUMMARY.md +250 -0
- package/schemas/README.md +284 -0
- package/schemas/common/error.schema.json +54 -0
- package/schemas/common/meta.schema.json +39 -0
- package/schemas/common/pagination.schema.json +32 -0
- package/schemas/index.json +159 -0
- package/schemas/requests/lifecycle/check.schema.json +20 -0
- package/schemas/requests/lifecycle/gate.fail.schema.json +25 -0
- package/schemas/requests/lifecycle/gate.pass.schema.json +28 -0
- package/schemas/requests/lifecycle/gates.schema.json +15 -0
- package/schemas/requests/lifecycle/history.schema.json +15 -0
- package/schemas/requests/lifecycle/prerequisites.schema.json +15 -0
- package/schemas/requests/lifecycle/progress.schema.json +29 -0
- package/schemas/requests/lifecycle/reset.schema.json +25 -0
- package/schemas/requests/lifecycle/skip.schema.json +25 -0
- package/schemas/requests/lifecycle/status.schema.json +23 -0
- package/schemas/requests/orchestrate/analyze.schema.json +15 -0
- package/schemas/requests/orchestrate/context.schema.json +13 -0
- package/schemas/requests/orchestrate/next.schema.json +15 -0
- package/schemas/requests/orchestrate/parallel.end.schema.json +20 -0
- package/schemas/requests/orchestrate/parallel.start.schema.json +20 -0
- package/schemas/requests/orchestrate/ready.schema.json +15 -0
- package/schemas/requests/orchestrate/skill.list.schema.json +13 -0
- package/schemas/requests/orchestrate/spawn.schema.json +25 -0
- package/schemas/requests/orchestrate/startup.schema.json +15 -0
- package/schemas/requests/orchestrate/status.schema.json +15 -0
- package/schemas/requests/orchestrate/validate.schema.json +15 -0
- package/schemas/requests/orchestrate/waves.schema.json +15 -0
- package/schemas/requests/release/changelog.schema.json +23 -0
- package/schemas/requests/release/commit.schema.json +22 -0
- package/schemas/requests/release/gates.run.schema.json +17 -0
- package/schemas/requests/release/prepare.schema.json +20 -0
- package/schemas/requests/release/push.schema.json +20 -0
- package/schemas/requests/release/rollback.schema.json +20 -0
- package/schemas/requests/release/tag.schema.json +19 -0
- package/schemas/requests/research/inject.schema.json +24 -0
- package/schemas/requests/research/link.schema.json +25 -0
- package/schemas/requests/research/list.schema.json +19 -0
- package/schemas/requests/research/manifest.append.schema.json +20 -0
- package/schemas/requests/research/manifest.archive.schema.json +19 -0
- package/schemas/requests/research/manifest.read.schema.json +21 -0
- package/schemas/requests/research/pending.schema.json +14 -0
- package/schemas/requests/research/query.schema.json +21 -0
- package/schemas/requests/research/show.schema.json +14 -0
- package/schemas/requests/research/stats.schema.json +14 -0
- package/schemas/requests/session/end.schema.json +13 -0
- package/schemas/requests/session/focus.clear.schema.json +7 -0
- package/schemas/requests/session/focus.get.schema.json +7 -0
- package/schemas/requests/session/focus.set.schema.json +15 -0
- package/schemas/requests/session/gc.schema.json +14 -0
- package/schemas/requests/session/history.schema.json +16 -0
- package/schemas/requests/session/list.schema.json +13 -0
- package/schemas/requests/session/resume.schema.json +14 -0
- package/schemas/requests/session/show.schema.json +14 -0
- package/schemas/requests/session/start.schema.json +23 -0
- package/schemas/requests/session/status.schema.json +7 -0
- package/schemas/requests/session/suspend.schema.json +13 -0
- package/schemas/requests/system/backup.schema.json +19 -0
- package/schemas/requests/system/cleanup.schema.json +20 -0
- package/schemas/requests/system/config.get.schema.json +14 -0
- package/schemas/requests/system/config.set.schema.json +24 -0
- package/schemas/requests/system/context.schema.json +7 -0
- package/schemas/requests/system/doctor.schema.json +7 -0
- package/schemas/requests/system/init.schema.json +18 -0
- package/schemas/requests/system/migrate.schema.json +19 -0
- package/schemas/requests/system/restore.schema.json +14 -0
- package/schemas/requests/system/stats.schema.json +7 -0
- package/schemas/requests/system/sync.schema.json +15 -0
- package/schemas/requests/system/version.schema.json +7 -0
- package/schemas/requests/tasks/analyze.schema.json +14 -0
- package/schemas/requests/tasks/archive.schema.json +19 -0
- package/schemas/requests/tasks/blockers.schema.json +15 -0
- package/schemas/requests/tasks/complete.schema.json +24 -0
- package/schemas/requests/tasks/create.schema.json +48 -0
- package/schemas/requests/tasks/delete.schema.json +20 -0
- package/schemas/requests/tasks/deps.schema.json +21 -0
- package/schemas/requests/tasks/exists.schema.json +15 -0
- package/schemas/requests/tasks/find.schema.json +22 -0
- package/schemas/requests/tasks/get.schema.json +15 -0
- package/schemas/requests/tasks/list.schema.json +26 -0
- package/schemas/requests/tasks/next.schema.json +21 -0
- package/schemas/requests/tasks/promote.schema.json +15 -0
- package/schemas/requests/tasks/reopen.schema.json +15 -0
- package/schemas/requests/tasks/reorder.schema.json +20 -0
- package/schemas/requests/tasks/reparent.schema.json +20 -0
- package/schemas/requests/tasks/tree.schema.json +21 -0
- package/schemas/requests/tasks/unarchive.schema.json +15 -0
- package/schemas/requests/tasks/update.schema.json +41 -0
- package/schemas/requests/validate/compliance.record.schema.json +20 -0
- package/schemas/requests/validate/compliance.summary.schema.json +18 -0
- package/schemas/requests/validate/compliance.violations.schema.json +19 -0
- package/schemas/requests/validate/manifest.schema.json +23 -0
- package/schemas/requests/validate/output.schema.json +19 -0
- package/schemas/requests/validate/protocol.schema.json +20 -0
- package/schemas/requests/validate/schema.schema.json +19 -0
- package/schemas/requests/validate/task.schema.json +21 -0
- package/schemas/requests/validate/test.coverage.schema.json +14 -0
- package/schemas/requests/validate/test.run.schema.json +22 -0
- package/schemas/requests/validate/test.status.schema.json +14 -0
- package/schemas/responses/common-error.schema.json +20 -0
- package/schemas/responses/common-success.schema.json +21 -0
- package/schemas/responses/lifecycle/check.schema.json +18 -0
- package/schemas/responses/lifecycle/gate.fail.schema.json +18 -0
- package/schemas/responses/lifecycle/gate.pass.schema.json +18 -0
- package/schemas/responses/lifecycle/gates.schema.json +18 -0
- package/schemas/responses/lifecycle/history.schema.json +18 -0
- package/schemas/responses/lifecycle/prerequisites.schema.json +18 -0
- package/schemas/responses/lifecycle/progress.schema.json +18 -0
- package/schemas/responses/lifecycle/reset.schema.json +18 -0
- package/schemas/responses/lifecycle/skip.schema.json +18 -0
- package/schemas/responses/lifecycle/status.schema.json +18 -0
- package/schemas/responses/orchestrate/analyze.schema.json +18 -0
- package/schemas/responses/orchestrate/context.schema.json +18 -0
- package/schemas/responses/orchestrate/next.schema.json +18 -0
- package/schemas/responses/orchestrate/parallel.end.schema.json +18 -0
- package/schemas/responses/orchestrate/parallel.start.schema.json +18 -0
- package/schemas/responses/orchestrate/ready.schema.json +18 -0
- package/schemas/responses/orchestrate/skill.list.schema.json +18 -0
- package/schemas/responses/orchestrate/spawn.schema.json +18 -0
- package/schemas/responses/orchestrate/startup.schema.json +18 -0
- package/schemas/responses/orchestrate/status.schema.json +18 -0
- package/schemas/responses/orchestrate/validate.schema.json +18 -0
- package/schemas/responses/orchestrate/waves.schema.json +18 -0
- package/schemas/responses/release/changelog.schema.json +18 -0
- package/schemas/responses/release/commit.schema.json +18 -0
- package/schemas/responses/release/gates.run.schema.json +18 -0
- package/schemas/responses/release/prepare.schema.json +18 -0
- package/schemas/responses/release/push.schema.json +18 -0
- package/schemas/responses/release/rollback.schema.json +18 -0
- package/schemas/responses/release/tag.schema.json +18 -0
- package/schemas/responses/research/inject.schema.json +18 -0
- package/schemas/responses/research/link.schema.json +18 -0
- package/schemas/responses/research/list.schema.json +18 -0
- package/schemas/responses/research/manifest.append.schema.json +18 -0
- package/schemas/responses/research/manifest.archive.schema.json +18 -0
- package/schemas/responses/research/manifest.read.schema.json +18 -0
- package/schemas/responses/research/pending.schema.json +18 -0
- package/schemas/responses/research/query.schema.json +18 -0
- package/schemas/responses/research/show.schema.json +18 -0
- package/schemas/responses/research/stats.schema.json +18 -0
- package/schemas/responses/session/end.schema.json +18 -0
- package/schemas/responses/session/focus.clear.schema.json +18 -0
- package/schemas/responses/session/focus.get.schema.json +18 -0
- package/schemas/responses/session/focus.set.schema.json +18 -0
- package/schemas/responses/session/gc.schema.json +18 -0
- package/schemas/responses/session/history.schema.json +18 -0
- package/schemas/responses/session/list.schema.json +18 -0
- package/schemas/responses/session/resume.schema.json +18 -0
- package/schemas/responses/session/show.schema.json +18 -0
- package/schemas/responses/session/start.schema.json +18 -0
- package/schemas/responses/session/status.schema.json +18 -0
- package/schemas/responses/session/suspend.schema.json +18 -0
- package/schemas/responses/system/backup.schema.json +18 -0
- package/schemas/responses/system/cleanup.schema.json +18 -0
- package/schemas/responses/system/config.get.schema.json +18 -0
- package/schemas/responses/system/config.set.schema.json +18 -0
- package/schemas/responses/system/context.schema.json +18 -0
- package/schemas/responses/system/doctor.schema.json +18 -0
- package/schemas/responses/system/init.schema.json +18 -0
- package/schemas/responses/system/migrate.schema.json +18 -0
- package/schemas/responses/system/restore.schema.json +18 -0
- package/schemas/responses/system/stats.schema.json +18 -0
- package/schemas/responses/system/sync.schema.json +18 -0
- package/schemas/responses/system/version.schema.json +18 -0
- package/schemas/responses/tasks/analyze.schema.json +18 -0
- package/schemas/responses/tasks/archive.schema.json +18 -0
- package/schemas/responses/tasks/blockers.schema.json +18 -0
- package/schemas/responses/tasks/complete.schema.json +18 -0
- package/schemas/responses/tasks/create.schema.json +18 -0
- package/schemas/responses/tasks/delete.schema.json +18 -0
- package/schemas/responses/tasks/deps.schema.json +18 -0
- package/schemas/responses/tasks/exists.schema.json +18 -0
- package/schemas/responses/tasks/find.schema.json +18 -0
- package/schemas/responses/tasks/get.schema.json +87 -0
- package/schemas/responses/tasks/list.schema.json +18 -0
- package/schemas/responses/tasks/next.schema.json +18 -0
- package/schemas/responses/tasks/promote.schema.json +18 -0
- package/schemas/responses/tasks/reopen.schema.json +18 -0
- package/schemas/responses/tasks/reorder.schema.json +18 -0
- package/schemas/responses/tasks/reparent.schema.json +18 -0
- package/schemas/responses/tasks/tree.schema.json +18 -0
- package/schemas/responses/tasks/unarchive.schema.json +18 -0
- package/schemas/responses/tasks/update.schema.json +18 -0
- package/schemas/responses/validate/compliance.record.schema.json +18 -0
- package/schemas/responses/validate/compliance.summary.schema.json +18 -0
- package/schemas/responses/validate/compliance.violations.schema.json +18 -0
- package/schemas/responses/validate/manifest.schema.json +18 -0
- package/schemas/responses/validate/output.schema.json +18 -0
- package/schemas/responses/validate/protocol.schema.json +18 -0
- package/schemas/responses/validate/schema.schema.json +18 -0
- package/schemas/responses/validate/task.schema.json +18 -0
- package/schemas/responses/validate/test.coverage.schema.json +18 -0
- package/schemas/responses/validate/test.run.schema.json +18 -0
- package/schemas/responses/validate/test.status.schema.json +18 -0
- package/server.json +53 -0
|
@@ -0,0 +1,1027 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exit code mapping for CLEO CLI operations
|
|
3
|
+
*
|
|
4
|
+
* @task T2913
|
|
5
|
+
* @epic T2908
|
|
6
|
+
*
|
|
7
|
+
* Maps all CLEO exit codes (1-100+) to error metadata with automatic
|
|
8
|
+
* fix command generation and contextual suggestions.
|
|
9
|
+
*
|
|
10
|
+
* Reference: lib/exit-codes.sh, lib/protocol-validation.sh
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Exit code enumeration (complete mapping 0-100+)
|
|
14
|
+
*/
|
|
15
|
+
export var ExitCode;
|
|
16
|
+
(function (ExitCode) {
|
|
17
|
+
// Success (0)
|
|
18
|
+
ExitCode[ExitCode["SUCCESS"] = 0] = "SUCCESS";
|
|
19
|
+
// General Errors (1-9)
|
|
20
|
+
ExitCode[ExitCode["E_GENERAL_ERROR"] = 1] = "E_GENERAL_ERROR";
|
|
21
|
+
ExitCode[ExitCode["E_INVALID_INPUT"] = 2] = "E_INVALID_INPUT";
|
|
22
|
+
ExitCode[ExitCode["E_FILE_ERROR"] = 3] = "E_FILE_ERROR";
|
|
23
|
+
ExitCode[ExitCode["E_NOT_FOUND"] = 4] = "E_NOT_FOUND";
|
|
24
|
+
ExitCode[ExitCode["E_DEPENDENCY_ERROR"] = 5] = "E_DEPENDENCY_ERROR";
|
|
25
|
+
ExitCode[ExitCode["E_VALIDATION_ERROR"] = 6] = "E_VALIDATION_ERROR";
|
|
26
|
+
ExitCode[ExitCode["E_LOCK_TIMEOUT"] = 7] = "E_LOCK_TIMEOUT";
|
|
27
|
+
ExitCode[ExitCode["E_CONFIG_ERROR"] = 8] = "E_CONFIG_ERROR";
|
|
28
|
+
// Hierarchy Errors (10-19)
|
|
29
|
+
ExitCode[ExitCode["E_PARENT_NOT_FOUND"] = 10] = "E_PARENT_NOT_FOUND";
|
|
30
|
+
ExitCode[ExitCode["E_DEPTH_EXCEEDED"] = 11] = "E_DEPTH_EXCEEDED";
|
|
31
|
+
ExitCode[ExitCode["E_SIBLING_LIMIT"] = 12] = "E_SIBLING_LIMIT";
|
|
32
|
+
ExitCode[ExitCode["E_INVALID_PARENT_TYPE"] = 13] = "E_INVALID_PARENT_TYPE";
|
|
33
|
+
ExitCode[ExitCode["E_CIRCULAR_REFERENCE"] = 14] = "E_CIRCULAR_REFERENCE";
|
|
34
|
+
ExitCode[ExitCode["E_ORPHAN_DETECTED"] = 15] = "E_ORPHAN_DETECTED";
|
|
35
|
+
ExitCode[ExitCode["E_HAS_CHILDREN"] = 16] = "E_HAS_CHILDREN";
|
|
36
|
+
ExitCode[ExitCode["E_TASK_COMPLETED"] = 17] = "E_TASK_COMPLETED";
|
|
37
|
+
ExitCode[ExitCode["E_CASCADE_FAILED"] = 18] = "E_CASCADE_FAILED";
|
|
38
|
+
ExitCode[ExitCode["E_HAS_DEPENDENTS"] = 19] = "E_HAS_DEPENDENTS";
|
|
39
|
+
// Concurrency Errors (20-29)
|
|
40
|
+
ExitCode[ExitCode["E_CHECKSUM_MISMATCH"] = 20] = "E_CHECKSUM_MISMATCH";
|
|
41
|
+
ExitCode[ExitCode["E_CONCURRENT_MODIFICATION"] = 21] = "E_CONCURRENT_MODIFICATION";
|
|
42
|
+
ExitCode[ExitCode["E_ID_COLLISION"] = 22] = "E_ID_COLLISION";
|
|
43
|
+
// Session Errors (30-39)
|
|
44
|
+
ExitCode[ExitCode["E_SESSION_EXISTS"] = 30] = "E_SESSION_EXISTS";
|
|
45
|
+
ExitCode[ExitCode["E_SESSION_NOT_FOUND"] = 31] = "E_SESSION_NOT_FOUND";
|
|
46
|
+
ExitCode[ExitCode["E_SCOPE_CONFLICT"] = 32] = "E_SCOPE_CONFLICT";
|
|
47
|
+
ExitCode[ExitCode["E_SCOPE_INVALID"] = 33] = "E_SCOPE_INVALID";
|
|
48
|
+
ExitCode[ExitCode["E_TASK_NOT_IN_SCOPE"] = 34] = "E_TASK_NOT_IN_SCOPE";
|
|
49
|
+
ExitCode[ExitCode["E_TASK_CLAIMED"] = 35] = "E_TASK_CLAIMED";
|
|
50
|
+
ExitCode[ExitCode["E_SESSION_REQUIRED"] = 36] = "E_SESSION_REQUIRED";
|
|
51
|
+
ExitCode[ExitCode["E_SESSION_CLOSE_BLOCKED"] = 37] = "E_SESSION_CLOSE_BLOCKED";
|
|
52
|
+
ExitCode[ExitCode["E_FOCUS_REQUIRED"] = 38] = "E_FOCUS_REQUIRED";
|
|
53
|
+
ExitCode[ExitCode["E_NOTES_REQUIRED"] = 39] = "E_NOTES_REQUIRED";
|
|
54
|
+
// Verification Errors (40-49)
|
|
55
|
+
ExitCode[ExitCode["E_VERIFICATION_INIT_FAILED"] = 40] = "E_VERIFICATION_INIT_FAILED";
|
|
56
|
+
ExitCode[ExitCode["E_GATE_UPDATE_FAILED"] = 41] = "E_GATE_UPDATE_FAILED";
|
|
57
|
+
ExitCode[ExitCode["E_INVALID_GATE"] = 42] = "E_INVALID_GATE";
|
|
58
|
+
ExitCode[ExitCode["E_INVALID_AGENT"] = 43] = "E_INVALID_AGENT";
|
|
59
|
+
ExitCode[ExitCode["E_MAX_ROUNDS_EXCEEDED"] = 44] = "E_MAX_ROUNDS_EXCEEDED";
|
|
60
|
+
ExitCode[ExitCode["E_GATE_DEPENDENCY"] = 45] = "E_GATE_DEPENDENCY";
|
|
61
|
+
ExitCode[ExitCode["E_VERIFICATION_LOCKED"] = 46] = "E_VERIFICATION_LOCKED";
|
|
62
|
+
ExitCode[ExitCode["E_ROUND_MISMATCH"] = 47] = "E_ROUND_MISMATCH";
|
|
63
|
+
// Context Safeguard Errors (50-59)
|
|
64
|
+
ExitCode[ExitCode["E_CONTEXT_WARNING"] = 50] = "E_CONTEXT_WARNING";
|
|
65
|
+
ExitCode[ExitCode["E_CONTEXT_CAUTION"] = 51] = "E_CONTEXT_CAUTION";
|
|
66
|
+
ExitCode[ExitCode["E_CONTEXT_CRITICAL"] = 52] = "E_CONTEXT_CRITICAL";
|
|
67
|
+
ExitCode[ExitCode["E_CONTEXT_EMERGENCY"] = 53] = "E_CONTEXT_EMERGENCY";
|
|
68
|
+
ExitCode[ExitCode["E_CONTEXT_STALE"] = 54] = "E_CONTEXT_STALE";
|
|
69
|
+
// Protocol Violations (60-70)
|
|
70
|
+
ExitCode[ExitCode["E_PROTOCOL_RESEARCH"] = 60] = "E_PROTOCOL_RESEARCH";
|
|
71
|
+
ExitCode[ExitCode["E_PROTOCOL_CONSENSUS"] = 61] = "E_PROTOCOL_CONSENSUS";
|
|
72
|
+
ExitCode[ExitCode["E_PROTOCOL_SPECIFICATION"] = 62] = "E_PROTOCOL_SPECIFICATION";
|
|
73
|
+
ExitCode[ExitCode["E_PROTOCOL_DECOMPOSITION"] = 63] = "E_PROTOCOL_DECOMPOSITION";
|
|
74
|
+
ExitCode[ExitCode["E_PROTOCOL_IMPLEMENTATION"] = 64] = "E_PROTOCOL_IMPLEMENTATION";
|
|
75
|
+
ExitCode[ExitCode["E_PROTOCOL_CONTRIBUTION"] = 65] = "E_PROTOCOL_CONTRIBUTION";
|
|
76
|
+
ExitCode[ExitCode["E_PROTOCOL_RELEASE"] = 66] = "E_PROTOCOL_RELEASE";
|
|
77
|
+
ExitCode[ExitCode["E_PROTOCOL_GENERIC"] = 67] = "E_PROTOCOL_GENERIC";
|
|
78
|
+
ExitCode[ExitCode["E_PROTOCOL_VALIDATION"] = 68] = "E_PROTOCOL_VALIDATION";
|
|
79
|
+
ExitCode[ExitCode["E_TESTS_SKIPPED"] = 69] = "E_TESTS_SKIPPED";
|
|
80
|
+
ExitCode[ExitCode["E_COVERAGE_INSUFFICIENT"] = 70] = "E_COVERAGE_INSUFFICIENT";
|
|
81
|
+
// Nexus Errors (71-79)
|
|
82
|
+
ExitCode[ExitCode["E_NEXUS_NOT_INITIALIZED"] = 71] = "E_NEXUS_NOT_INITIALIZED";
|
|
83
|
+
ExitCode[ExitCode["E_NEXUS_PROJECT_NOT_FOUND"] = 72] = "E_NEXUS_PROJECT_NOT_FOUND";
|
|
84
|
+
ExitCode[ExitCode["E_NEXUS_PERMISSION_DENIED"] = 73] = "E_NEXUS_PERMISSION_DENIED";
|
|
85
|
+
ExitCode[ExitCode["E_NEXUS_INVALID_SYNTAX"] = 74] = "E_NEXUS_INVALID_SYNTAX";
|
|
86
|
+
ExitCode[ExitCode["E_NEXUS_SYNC_FAILED"] = 75] = "E_NEXUS_SYNC_FAILED";
|
|
87
|
+
ExitCode[ExitCode["E_NEXUS_REGISTRY_CORRUPT"] = 76] = "E_NEXUS_REGISTRY_CORRUPT";
|
|
88
|
+
ExitCode[ExitCode["E_NEXUS_PROJECT_EXISTS"] = 77] = "E_NEXUS_PROJECT_EXISTS";
|
|
89
|
+
ExitCode[ExitCode["E_NEXUS_QUERY_FAILED"] = 78] = "E_NEXUS_QUERY_FAILED";
|
|
90
|
+
ExitCode[ExitCode["E_NEXUS_GRAPH_ERROR"] = 79] = "E_NEXUS_GRAPH_ERROR";
|
|
91
|
+
// Lifecycle Enforcement Errors (80-84)
|
|
92
|
+
ExitCode[ExitCode["E_LIFECYCLE_GATE_FAILED"] = 80] = "E_LIFECYCLE_GATE_FAILED";
|
|
93
|
+
ExitCode[ExitCode["E_AUDIT_MISSING"] = 81] = "E_AUDIT_MISSING";
|
|
94
|
+
ExitCode[ExitCode["E_CIRCULAR_VALIDATION"] = 82] = "E_CIRCULAR_VALIDATION";
|
|
95
|
+
ExitCode[ExitCode["E_LIFECYCLE_TRANSITION_INVALID"] = 83] = "E_LIFECYCLE_TRANSITION_INVALID";
|
|
96
|
+
ExitCode[ExitCode["E_PROVENANCE_REQUIRED"] = 84] = "E_PROVENANCE_REQUIRED";
|
|
97
|
+
// Special Codes (100+)
|
|
98
|
+
ExitCode[ExitCode["E_NO_DATA"] = 100] = "E_NO_DATA";
|
|
99
|
+
ExitCode[ExitCode["E_ALREADY_EXISTS"] = 101] = "E_ALREADY_EXISTS";
|
|
100
|
+
ExitCode[ExitCode["E_NO_CHANGE"] = 102] = "E_NO_CHANGE";
|
|
101
|
+
})(ExitCode || (ExitCode = {}));
|
|
102
|
+
/**
|
|
103
|
+
* Error severity levels
|
|
104
|
+
*/
|
|
105
|
+
export var ErrorSeverity;
|
|
106
|
+
(function (ErrorSeverity) {
|
|
107
|
+
ErrorSeverity["INFO"] = "info";
|
|
108
|
+
ErrorSeverity["WARNING"] = "warning";
|
|
109
|
+
ErrorSeverity["ERROR"] = "error";
|
|
110
|
+
ErrorSeverity["CRITICAL"] = "critical";
|
|
111
|
+
})(ErrorSeverity || (ErrorSeverity = {}));
|
|
112
|
+
/**
|
|
113
|
+
* Error category for grouping
|
|
114
|
+
*/
|
|
115
|
+
export var ErrorCategory;
|
|
116
|
+
(function (ErrorCategory) {
|
|
117
|
+
ErrorCategory["GENERAL"] = "general";
|
|
118
|
+
ErrorCategory["HIERARCHY"] = "hierarchy";
|
|
119
|
+
ErrorCategory["CONCURRENCY"] = "concurrency";
|
|
120
|
+
ErrorCategory["SESSION"] = "session";
|
|
121
|
+
ErrorCategory["VERIFICATION"] = "verification";
|
|
122
|
+
ErrorCategory["CONTEXT"] = "context";
|
|
123
|
+
ErrorCategory["PROTOCOL"] = "protocol";
|
|
124
|
+
ErrorCategory["NEXUS"] = "nexus";
|
|
125
|
+
ErrorCategory["LIFECYCLE"] = "lifecycle";
|
|
126
|
+
ErrorCategory["SPECIAL"] = "special";
|
|
127
|
+
})(ErrorCategory || (ErrorCategory = {}));
|
|
128
|
+
/**
|
|
129
|
+
* Complete exit code to error mapping
|
|
130
|
+
*/
|
|
131
|
+
export const ERROR_MAP = {
|
|
132
|
+
// Success
|
|
133
|
+
[ExitCode.SUCCESS]: {
|
|
134
|
+
code: 'SUCCESS',
|
|
135
|
+
name: 'Success',
|
|
136
|
+
description: 'Operation completed successfully',
|
|
137
|
+
category: ErrorCategory.SPECIAL,
|
|
138
|
+
severity: ErrorSeverity.INFO,
|
|
139
|
+
retryable: false,
|
|
140
|
+
},
|
|
141
|
+
// General Errors (1-9)
|
|
142
|
+
[ExitCode.E_GENERAL_ERROR]: {
|
|
143
|
+
code: 'E_GENERAL_ERROR',
|
|
144
|
+
name: 'General Error',
|
|
145
|
+
description: 'Unspecified error occurred',
|
|
146
|
+
category: ErrorCategory.GENERAL,
|
|
147
|
+
severity: ErrorSeverity.ERROR,
|
|
148
|
+
retryable: true,
|
|
149
|
+
fixTemplate: 'Check command syntax and parameters',
|
|
150
|
+
},
|
|
151
|
+
[ExitCode.E_INVALID_INPUT]: {
|
|
152
|
+
code: 'E_INVALID_INPUT',
|
|
153
|
+
name: 'Invalid Input',
|
|
154
|
+
description: 'Invalid user input or command-line arguments',
|
|
155
|
+
category: ErrorCategory.GENERAL,
|
|
156
|
+
severity: ErrorSeverity.ERROR,
|
|
157
|
+
retryable: false,
|
|
158
|
+
fixTemplate: 'Verify command parameters: {details}',
|
|
159
|
+
alternatives: [
|
|
160
|
+
{ action: 'Show command help', command: 'cleo help {command}' },
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
[ExitCode.E_FILE_ERROR]: {
|
|
164
|
+
code: 'E_FILE_ERROR',
|
|
165
|
+
name: 'File Error',
|
|
166
|
+
description: 'File system operation failed',
|
|
167
|
+
category: ErrorCategory.GENERAL,
|
|
168
|
+
severity: ErrorSeverity.ERROR,
|
|
169
|
+
retryable: false,
|
|
170
|
+
fixTemplate: 'Check file permissions and disk space',
|
|
171
|
+
},
|
|
172
|
+
[ExitCode.E_NOT_FOUND]: {
|
|
173
|
+
code: 'E_NOT_FOUND',
|
|
174
|
+
name: 'Not Found',
|
|
175
|
+
description: 'Requested resource not found',
|
|
176
|
+
category: ErrorCategory.GENERAL,
|
|
177
|
+
severity: ErrorSeverity.ERROR,
|
|
178
|
+
retryable: false,
|
|
179
|
+
fixTemplate: 'Verify resource exists: {resource}',
|
|
180
|
+
alternatives: [
|
|
181
|
+
{ action: 'List available resources', command: 'cleo list' },
|
|
182
|
+
{ action: 'Search for resource', command: 'cleo find "{query}"' },
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
[ExitCode.E_DEPENDENCY_ERROR]: {
|
|
186
|
+
code: 'E_DEPENDENCY_ERROR',
|
|
187
|
+
name: 'Dependency Error',
|
|
188
|
+
description: 'Missing required dependency',
|
|
189
|
+
category: ErrorCategory.GENERAL,
|
|
190
|
+
severity: ErrorSeverity.CRITICAL,
|
|
191
|
+
retryable: false,
|
|
192
|
+
fixTemplate: 'Install required dependency: {dependency}',
|
|
193
|
+
},
|
|
194
|
+
[ExitCode.E_VALIDATION_ERROR]: {
|
|
195
|
+
code: 'E_VALIDATION_ERROR',
|
|
196
|
+
name: 'Validation Error',
|
|
197
|
+
description: 'Data validation failed',
|
|
198
|
+
category: ErrorCategory.GENERAL,
|
|
199
|
+
severity: ErrorSeverity.ERROR,
|
|
200
|
+
retryable: false,
|
|
201
|
+
fixTemplate: 'Fix validation errors: {violations}',
|
|
202
|
+
},
|
|
203
|
+
[ExitCode.E_LOCK_TIMEOUT]: {
|
|
204
|
+
code: 'E_LOCK_TIMEOUT',
|
|
205
|
+
name: 'Lock Timeout',
|
|
206
|
+
description: 'Failed to acquire file lock within timeout',
|
|
207
|
+
category: ErrorCategory.CONCURRENCY,
|
|
208
|
+
severity: ErrorSeverity.WARNING,
|
|
209
|
+
retryable: true,
|
|
210
|
+
fixTemplate: 'Wait for concurrent operation to complete, then retry',
|
|
211
|
+
},
|
|
212
|
+
[ExitCode.E_CONFIG_ERROR]: {
|
|
213
|
+
code: 'E_CONFIG_ERROR',
|
|
214
|
+
name: 'Configuration Error',
|
|
215
|
+
description: 'Configuration error',
|
|
216
|
+
category: ErrorCategory.GENERAL,
|
|
217
|
+
severity: ErrorSeverity.ERROR,
|
|
218
|
+
retryable: false,
|
|
219
|
+
fixTemplate: 'Check configuration file: .cleo/config.json',
|
|
220
|
+
alternatives: [
|
|
221
|
+
{ action: 'Show config', command: 'cleo config show' },
|
|
222
|
+
{ action: 'Validate config', command: 'cleo --validate' },
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
// Hierarchy Errors (10-19)
|
|
226
|
+
[ExitCode.E_PARENT_NOT_FOUND]: {
|
|
227
|
+
code: 'E_PARENT_NOT_FOUND',
|
|
228
|
+
name: 'Parent Not Found',
|
|
229
|
+
description: 'Parent task does not exist',
|
|
230
|
+
category: ErrorCategory.HIERARCHY,
|
|
231
|
+
severity: ErrorSeverity.ERROR,
|
|
232
|
+
retryable: false,
|
|
233
|
+
fixTemplate: 'Create parent task first or remove --parent flag',
|
|
234
|
+
alternatives: [
|
|
235
|
+
{ action: 'List tasks', command: 'cleo list' },
|
|
236
|
+
{ action: 'Check task exists', command: 'cleo exists {parentId}' },
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
[ExitCode.E_DEPTH_EXCEEDED]: {
|
|
240
|
+
code: 'E_DEPTH_EXCEEDED',
|
|
241
|
+
name: 'Depth Exceeded',
|
|
242
|
+
description: 'Maximum hierarchy depth (3) would be exceeded',
|
|
243
|
+
category: ErrorCategory.HIERARCHY,
|
|
244
|
+
severity: ErrorSeverity.ERROR,
|
|
245
|
+
retryable: false,
|
|
246
|
+
fixTemplate: 'Create task at higher level (max depth: epic→task→subtask)',
|
|
247
|
+
alternatives: [
|
|
248
|
+
{ action: 'View hierarchy', command: 'cleo tree {parentId}' },
|
|
249
|
+
{ action: 'Create as sibling', command: 'Remove --parent flag' },
|
|
250
|
+
],
|
|
251
|
+
},
|
|
252
|
+
[ExitCode.E_SIBLING_LIMIT]: {
|
|
253
|
+
code: 'E_SIBLING_LIMIT',
|
|
254
|
+
name: 'Sibling Limit',
|
|
255
|
+
description: 'Maximum siblings (7) would be exceeded',
|
|
256
|
+
category: ErrorCategory.HIERARCHY,
|
|
257
|
+
severity: ErrorSeverity.ERROR,
|
|
258
|
+
retryable: false,
|
|
259
|
+
fixTemplate: 'Create new parent to group related tasks',
|
|
260
|
+
alternatives: [
|
|
261
|
+
{ action: 'List siblings', command: 'cleo list --parent {parentId}' },
|
|
262
|
+
{ action: 'Create new epic', command: 'cleo add "New Group" --parent {grandparentId}' },
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
[ExitCode.E_INVALID_PARENT_TYPE]: {
|
|
266
|
+
code: 'E_INVALID_PARENT_TYPE',
|
|
267
|
+
name: 'Invalid Parent Type',
|
|
268
|
+
description: 'Subtask cannot have children',
|
|
269
|
+
category: ErrorCategory.HIERARCHY,
|
|
270
|
+
severity: ErrorSeverity.ERROR,
|
|
271
|
+
retryable: false,
|
|
272
|
+
fixTemplate: 'Promote subtask to task first: cleo promote {parentId}',
|
|
273
|
+
},
|
|
274
|
+
[ExitCode.E_CIRCULAR_REFERENCE]: {
|
|
275
|
+
code: 'E_CIRCULAR_REFERENCE',
|
|
276
|
+
name: 'Circular Reference',
|
|
277
|
+
description: 'Operation would create circular reference',
|
|
278
|
+
category: ErrorCategory.HIERARCHY,
|
|
279
|
+
severity: ErrorSeverity.ERROR,
|
|
280
|
+
retryable: false,
|
|
281
|
+
fixTemplate: 'Cannot create circular dependency: {cycle}',
|
|
282
|
+
alternatives: [
|
|
283
|
+
{ action: 'View dependencies', command: 'cleo deps {taskId}' },
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
[ExitCode.E_ORPHAN_DETECTED]: {
|
|
287
|
+
code: 'E_ORPHAN_DETECTED',
|
|
288
|
+
name: 'Orphan Detected',
|
|
289
|
+
description: 'Task has invalid parentId (orphan detected)',
|
|
290
|
+
category: ErrorCategory.HIERARCHY,
|
|
291
|
+
severity: ErrorSeverity.ERROR,
|
|
292
|
+
retryable: false,
|
|
293
|
+
fixTemplate: 'Remove parent reference or restore parent task',
|
|
294
|
+
alternatives: [
|
|
295
|
+
{ action: 'Remove parent', command: 'cleo update {taskId} --no-parent' },
|
|
296
|
+
{ action: 'Unarchive parent', command: 'cleo unarchive {parentId}' },
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
[ExitCode.E_HAS_CHILDREN]: {
|
|
300
|
+
code: 'E_HAS_CHILDREN',
|
|
301
|
+
name: 'Has Children',
|
|
302
|
+
description: 'Task has children, cannot delete without strategy',
|
|
303
|
+
category: ErrorCategory.HIERARCHY,
|
|
304
|
+
severity: ErrorSeverity.ERROR,
|
|
305
|
+
retryable: false,
|
|
306
|
+
fixTemplate: 'Specify deletion strategy: --cascade, --reparent, or --orphan',
|
|
307
|
+
alternatives: [
|
|
308
|
+
{ action: 'List children', command: 'cleo list --parent {taskId}' },
|
|
309
|
+
{ action: 'Cascade delete', command: 'cleo delete {taskId} --cascade' },
|
|
310
|
+
{ action: 'Reparent children', command: 'cleo delete {taskId} --reparent {newParentId}' },
|
|
311
|
+
],
|
|
312
|
+
},
|
|
313
|
+
[ExitCode.E_TASK_COMPLETED]: {
|
|
314
|
+
code: 'E_TASK_COMPLETED',
|
|
315
|
+
name: 'Task Completed',
|
|
316
|
+
description: 'Task is completed, should use archive instead',
|
|
317
|
+
category: ErrorCategory.HIERARCHY,
|
|
318
|
+
severity: ErrorSeverity.WARNING,
|
|
319
|
+
retryable: false,
|
|
320
|
+
fixTemplate: 'Archive completed task: cleo archive {taskId}',
|
|
321
|
+
},
|
|
322
|
+
[ExitCode.E_CASCADE_FAILED]: {
|
|
323
|
+
code: 'E_CASCADE_FAILED',
|
|
324
|
+
name: 'Cascade Failed',
|
|
325
|
+
description: 'Cascade deletion partially failed',
|
|
326
|
+
category: ErrorCategory.HIERARCHY,
|
|
327
|
+
severity: ErrorSeverity.ERROR,
|
|
328
|
+
retryable: false,
|
|
329
|
+
fixTemplate: 'Some child tasks failed to delete: {failures}',
|
|
330
|
+
},
|
|
331
|
+
[ExitCode.E_HAS_DEPENDENTS]: {
|
|
332
|
+
code: 'E_HAS_DEPENDENTS',
|
|
333
|
+
name: 'Has Dependents',
|
|
334
|
+
description: 'Task has dependents, cannot delete without --orphan flag',
|
|
335
|
+
category: ErrorCategory.HIERARCHY,
|
|
336
|
+
severity: ErrorSeverity.ERROR,
|
|
337
|
+
retryable: false,
|
|
338
|
+
fixTemplate: 'Other tasks depend on this: cleo delete {taskId} --orphan',
|
|
339
|
+
alternatives: [
|
|
340
|
+
{ action: 'List dependents', command: 'cleo deps {taskId} --reverse' },
|
|
341
|
+
{ action: 'Force delete', command: 'cleo delete {taskId} --orphan' },
|
|
342
|
+
],
|
|
343
|
+
},
|
|
344
|
+
// Concurrency Errors (20-29)
|
|
345
|
+
[ExitCode.E_CHECKSUM_MISMATCH]: {
|
|
346
|
+
code: 'E_CHECKSUM_MISMATCH',
|
|
347
|
+
name: 'Checksum Mismatch',
|
|
348
|
+
description: 'File was modified externally between read and write',
|
|
349
|
+
category: ErrorCategory.CONCURRENCY,
|
|
350
|
+
severity: ErrorSeverity.WARNING,
|
|
351
|
+
retryable: true,
|
|
352
|
+
fixTemplate: 'File modified by another process, retrying operation',
|
|
353
|
+
},
|
|
354
|
+
[ExitCode.E_CONCURRENT_MODIFICATION]: {
|
|
355
|
+
code: 'E_CONCURRENT_MODIFICATION',
|
|
356
|
+
name: 'Concurrent Modification',
|
|
357
|
+
description: 'Concurrent modification detected during multi-agent operation',
|
|
358
|
+
category: ErrorCategory.CONCURRENCY,
|
|
359
|
+
severity: ErrorSeverity.WARNING,
|
|
360
|
+
retryable: true,
|
|
361
|
+
fixTemplate: 'Wait for concurrent agent to complete, then retry',
|
|
362
|
+
},
|
|
363
|
+
[ExitCode.E_ID_COLLISION]: {
|
|
364
|
+
code: 'E_ID_COLLISION',
|
|
365
|
+
name: 'ID Collision',
|
|
366
|
+
description: 'ID generation collision',
|
|
367
|
+
category: ErrorCategory.CONCURRENCY,
|
|
368
|
+
severity: ErrorSeverity.WARNING,
|
|
369
|
+
retryable: true,
|
|
370
|
+
fixTemplate: 'ID collision detected, regenerating unique ID',
|
|
371
|
+
},
|
|
372
|
+
// Session Errors (30-39)
|
|
373
|
+
[ExitCode.E_SESSION_EXISTS]: {
|
|
374
|
+
code: 'E_SESSION_EXISTS',
|
|
375
|
+
name: 'Session Exists',
|
|
376
|
+
description: 'Session already active for this scope',
|
|
377
|
+
category: ErrorCategory.SESSION,
|
|
378
|
+
severity: ErrorSeverity.ERROR,
|
|
379
|
+
retryable: false,
|
|
380
|
+
fixTemplate: 'Resume existing session: cleo session resume {sessionId}',
|
|
381
|
+
alternatives: [
|
|
382
|
+
{ action: 'List sessions', command: 'cleo session list' },
|
|
383
|
+
{ action: 'Resume session', command: 'cleo session resume {sessionId}' },
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
[ExitCode.E_SESSION_NOT_FOUND]: {
|
|
387
|
+
code: 'E_SESSION_NOT_FOUND',
|
|
388
|
+
name: 'Session Not Found',
|
|
389
|
+
description: 'Session ID not found',
|
|
390
|
+
category: ErrorCategory.SESSION,
|
|
391
|
+
severity: ErrorSeverity.ERROR,
|
|
392
|
+
retryable: false,
|
|
393
|
+
fixTemplate: 'Start new session: cleo session start --scope epic:{epicId}',
|
|
394
|
+
alternatives: [
|
|
395
|
+
{ action: 'List sessions', command: 'cleo session list' },
|
|
396
|
+
{ action: 'Start session', command: 'cleo session start --scope epic:{epicId}' },
|
|
397
|
+
],
|
|
398
|
+
},
|
|
399
|
+
[ExitCode.E_SCOPE_CONFLICT]: {
|
|
400
|
+
code: 'E_SCOPE_CONFLICT',
|
|
401
|
+
name: 'Scope Conflict',
|
|
402
|
+
description: 'Session scope conflicts with existing session',
|
|
403
|
+
category: ErrorCategory.SESSION,
|
|
404
|
+
severity: ErrorSeverity.ERROR,
|
|
405
|
+
retryable: false,
|
|
406
|
+
fixTemplate: 'Another session is active for this epic',
|
|
407
|
+
alternatives: [
|
|
408
|
+
{ action: 'List active sessions', command: 'cleo session list --active' },
|
|
409
|
+
{ action: 'End conflicting session', command: 'cleo session end --session {conflictingId}' },
|
|
410
|
+
],
|
|
411
|
+
},
|
|
412
|
+
[ExitCode.E_SCOPE_INVALID]: {
|
|
413
|
+
code: 'E_SCOPE_INVALID',
|
|
414
|
+
name: 'Scope Invalid',
|
|
415
|
+
description: 'Invalid session scope (no epic, empty, etc.)',
|
|
416
|
+
category: ErrorCategory.SESSION,
|
|
417
|
+
severity: ErrorSeverity.ERROR,
|
|
418
|
+
retryable: false,
|
|
419
|
+
fixTemplate: 'Specify valid epic scope: --scope epic:{epicId}',
|
|
420
|
+
alternatives: [
|
|
421
|
+
{ action: 'List epics', command: 'cleo list --type epic' },
|
|
422
|
+
],
|
|
423
|
+
},
|
|
424
|
+
[ExitCode.E_TASK_NOT_IN_SCOPE]: {
|
|
425
|
+
code: 'E_TASK_NOT_IN_SCOPE',
|
|
426
|
+
name: 'Task Not In Scope',
|
|
427
|
+
description: 'Task is not within session scope',
|
|
428
|
+
category: ErrorCategory.SESSION,
|
|
429
|
+
severity: ErrorSeverity.ERROR,
|
|
430
|
+
retryable: false,
|
|
431
|
+
fixTemplate: 'Task {taskId} is not in current session scope',
|
|
432
|
+
alternatives: [
|
|
433
|
+
{ action: 'View session scope', command: 'cleo session status' },
|
|
434
|
+
{ action: 'View task tree', command: 'cleo tree {taskId}' },
|
|
435
|
+
],
|
|
436
|
+
},
|
|
437
|
+
[ExitCode.E_TASK_CLAIMED]: {
|
|
438
|
+
code: 'E_TASK_CLAIMED',
|
|
439
|
+
name: 'Task Claimed',
|
|
440
|
+
description: 'Task is already claimed by another agent',
|
|
441
|
+
category: ErrorCategory.SESSION,
|
|
442
|
+
severity: ErrorSeverity.ERROR,
|
|
443
|
+
retryable: false,
|
|
444
|
+
fixTemplate: 'Task claimed by another session: {claimingSession}',
|
|
445
|
+
alternatives: [
|
|
446
|
+
{ action: 'List active sessions', command: 'cleo session list --active' },
|
|
447
|
+
{ action: 'Choose different task', command: 'cleo next' },
|
|
448
|
+
],
|
|
449
|
+
},
|
|
450
|
+
[ExitCode.E_SESSION_REQUIRED]: {
|
|
451
|
+
code: 'E_SESSION_REQUIRED',
|
|
452
|
+
name: 'Session Required',
|
|
453
|
+
description: 'Operation requires an active session',
|
|
454
|
+
category: ErrorCategory.SESSION,
|
|
455
|
+
severity: ErrorSeverity.ERROR,
|
|
456
|
+
retryable: false,
|
|
457
|
+
fixTemplate: 'Start session first: cleo session start --scope epic:{epicId} --auto-focus',
|
|
458
|
+
alternatives: [
|
|
459
|
+
{ action: 'Start session', command: 'cleo session start --scope epic:{epicId} --auto-focus' },
|
|
460
|
+
{ action: 'Resume session', command: 'cleo session resume {sessionId}' },
|
|
461
|
+
],
|
|
462
|
+
},
|
|
463
|
+
[ExitCode.E_SESSION_CLOSE_BLOCKED]: {
|
|
464
|
+
code: 'E_SESSION_CLOSE_BLOCKED',
|
|
465
|
+
name: 'Session Close Blocked',
|
|
466
|
+
description: 'Cannot close session with incomplete tasks',
|
|
467
|
+
category: ErrorCategory.SESSION,
|
|
468
|
+
severity: ErrorSeverity.ERROR,
|
|
469
|
+
retryable: false,
|
|
470
|
+
fixTemplate: 'Complete pending tasks before closing session',
|
|
471
|
+
alternatives: [
|
|
472
|
+
{ action: 'List pending tasks', command: 'cleo list --status pending --parent {epicId}' },
|
|
473
|
+
{ action: 'Suspend session', command: 'cleo session suspend --note "Reason"' },
|
|
474
|
+
],
|
|
475
|
+
},
|
|
476
|
+
[ExitCode.E_FOCUS_REQUIRED]: {
|
|
477
|
+
code: 'E_FOCUS_REQUIRED',
|
|
478
|
+
name: 'Focus Required',
|
|
479
|
+
description: 'Operation requires a focused task',
|
|
480
|
+
category: ErrorCategory.SESSION,
|
|
481
|
+
severity: ErrorSeverity.ERROR,
|
|
482
|
+
retryable: false,
|
|
483
|
+
fixTemplate: 'Set focus first: cleo focus set {taskId}',
|
|
484
|
+
alternatives: [
|
|
485
|
+
{ action: 'Get next task', command: 'cleo next' },
|
|
486
|
+
{ action: 'Set focus', command: 'cleo focus set {taskId}' },
|
|
487
|
+
],
|
|
488
|
+
},
|
|
489
|
+
[ExitCode.E_NOTES_REQUIRED]: {
|
|
490
|
+
code: 'E_NOTES_REQUIRED',
|
|
491
|
+
name: 'Notes Required',
|
|
492
|
+
description: 'Session notes required for operation',
|
|
493
|
+
category: ErrorCategory.SESSION,
|
|
494
|
+
severity: ErrorSeverity.ERROR,
|
|
495
|
+
retryable: false,
|
|
496
|
+
fixTemplate: 'Add notes: --note "Session summary"',
|
|
497
|
+
},
|
|
498
|
+
// Verification Errors (40-49)
|
|
499
|
+
[ExitCode.E_VERIFICATION_INIT_FAILED]: {
|
|
500
|
+
code: 'E_VERIFICATION_INIT_FAILED',
|
|
501
|
+
name: 'Verification Init Failed',
|
|
502
|
+
description: 'Verification initialization failed',
|
|
503
|
+
category: ErrorCategory.VERIFICATION,
|
|
504
|
+
severity: ErrorSeverity.ERROR,
|
|
505
|
+
retryable: false,
|
|
506
|
+
fixTemplate: 'Cannot initialize verification object for task {taskId}',
|
|
507
|
+
},
|
|
508
|
+
[ExitCode.E_GATE_UPDATE_FAILED]: {
|
|
509
|
+
code: 'E_GATE_UPDATE_FAILED',
|
|
510
|
+
name: 'Gate Update Failed',
|
|
511
|
+
description: 'Gate update failed',
|
|
512
|
+
category: ErrorCategory.VERIFICATION,
|
|
513
|
+
severity: ErrorSeverity.ERROR,
|
|
514
|
+
retryable: false,
|
|
515
|
+
fixTemplate: 'Cannot update gate {gateName}: {reason}',
|
|
516
|
+
},
|
|
517
|
+
[ExitCode.E_INVALID_GATE]: {
|
|
518
|
+
code: 'E_INVALID_GATE',
|
|
519
|
+
name: 'Invalid Gate',
|
|
520
|
+
description: 'Invalid gate name',
|
|
521
|
+
category: ErrorCategory.VERIFICATION,
|
|
522
|
+
severity: ErrorSeverity.ERROR,
|
|
523
|
+
retryable: false,
|
|
524
|
+
fixTemplate: 'Unknown gate: {gateName}',
|
|
525
|
+
alternatives: [
|
|
526
|
+
{ action: 'List valid gates', command: 'cleo gate list' },
|
|
527
|
+
],
|
|
528
|
+
},
|
|
529
|
+
[ExitCode.E_INVALID_AGENT]: {
|
|
530
|
+
code: 'E_INVALID_AGENT',
|
|
531
|
+
name: 'Invalid Agent',
|
|
532
|
+
description: 'Invalid agent name',
|
|
533
|
+
category: ErrorCategory.VERIFICATION,
|
|
534
|
+
severity: ErrorSeverity.ERROR,
|
|
535
|
+
retryable: false,
|
|
536
|
+
fixTemplate: 'Unknown agent: {agentName}',
|
|
537
|
+
alternatives: [
|
|
538
|
+
{ action: 'List valid agents', command: 'skill list' },
|
|
539
|
+
],
|
|
540
|
+
},
|
|
541
|
+
[ExitCode.E_MAX_ROUNDS_EXCEEDED]: {
|
|
542
|
+
code: 'E_MAX_ROUNDS_EXCEEDED',
|
|
543
|
+
name: 'Max Rounds Exceeded',
|
|
544
|
+
description: 'Maximum implementation rounds exceeded',
|
|
545
|
+
category: ErrorCategory.VERIFICATION,
|
|
546
|
+
severity: ErrorSeverity.ERROR,
|
|
547
|
+
retryable: false,
|
|
548
|
+
fixTemplate: 'Exceeded max rounds ({maxRounds}), escalating to HITL',
|
|
549
|
+
},
|
|
550
|
+
[ExitCode.E_GATE_DEPENDENCY]: {
|
|
551
|
+
code: 'E_GATE_DEPENDENCY',
|
|
552
|
+
name: 'Gate Dependency',
|
|
553
|
+
description: 'Gate dependency not met',
|
|
554
|
+
category: ErrorCategory.VERIFICATION,
|
|
555
|
+
severity: ErrorSeverity.ERROR,
|
|
556
|
+
retryable: false,
|
|
557
|
+
fixTemplate: 'Complete prerequisite gate first: {prerequisiteGate}',
|
|
558
|
+
alternatives: [
|
|
559
|
+
{ action: 'View gate status', command: 'cleo lifecycle gates {taskId}' },
|
|
560
|
+
],
|
|
561
|
+
},
|
|
562
|
+
[ExitCode.E_VERIFICATION_LOCKED]: {
|
|
563
|
+
code: 'E_VERIFICATION_LOCKED',
|
|
564
|
+
name: 'Verification Locked',
|
|
565
|
+
description: 'Verification is locked (cannot modify)',
|
|
566
|
+
category: ErrorCategory.VERIFICATION,
|
|
567
|
+
severity: ErrorSeverity.ERROR,
|
|
568
|
+
retryable: false,
|
|
569
|
+
fixTemplate: 'Verification locked, cannot modify gates',
|
|
570
|
+
},
|
|
571
|
+
[ExitCode.E_ROUND_MISMATCH]: {
|
|
572
|
+
code: 'E_ROUND_MISMATCH',
|
|
573
|
+
name: 'Round Mismatch',
|
|
574
|
+
description: 'Round number mismatch',
|
|
575
|
+
category: ErrorCategory.VERIFICATION,
|
|
576
|
+
severity: ErrorSeverity.ERROR,
|
|
577
|
+
retryable: false,
|
|
578
|
+
fixTemplate: 'Round mismatch: expected {expectedRound}, got {actualRound}',
|
|
579
|
+
},
|
|
580
|
+
// Context Safeguard Errors (50-59)
|
|
581
|
+
[ExitCode.E_CONTEXT_WARNING]: {
|
|
582
|
+
code: 'E_CONTEXT_WARNING',
|
|
583
|
+
name: 'Context Warning',
|
|
584
|
+
description: 'Context warning threshold reached (70-84%)',
|
|
585
|
+
category: ErrorCategory.CONTEXT,
|
|
586
|
+
severity: ErrorSeverity.WARNING,
|
|
587
|
+
retryable: false,
|
|
588
|
+
fixTemplate: 'Context usage at {percentage}%, consider using cleo safestop',
|
|
589
|
+
alternatives: [
|
|
590
|
+
{ action: 'Check context', command: 'cleo context' },
|
|
591
|
+
{ action: 'Safe stop', command: 'cleo safestop' },
|
|
592
|
+
],
|
|
593
|
+
},
|
|
594
|
+
[ExitCode.E_CONTEXT_CAUTION]: {
|
|
595
|
+
code: 'E_CONTEXT_CAUTION',
|
|
596
|
+
name: 'Context Caution',
|
|
597
|
+
description: 'Context caution threshold reached (85-89%)',
|
|
598
|
+
category: ErrorCategory.CONTEXT,
|
|
599
|
+
severity: ErrorSeverity.WARNING,
|
|
600
|
+
retryable: false,
|
|
601
|
+
fixTemplate: 'Context usage at {percentage}%, recommend using cleo safestop',
|
|
602
|
+
alternatives: [
|
|
603
|
+
{ action: 'Check context', command: 'cleo context' },
|
|
604
|
+
{ action: 'Safe stop', command: 'cleo safestop' },
|
|
605
|
+
],
|
|
606
|
+
},
|
|
607
|
+
[ExitCode.E_CONTEXT_CRITICAL]: {
|
|
608
|
+
code: 'E_CONTEXT_CRITICAL',
|
|
609
|
+
name: 'Context Critical',
|
|
610
|
+
description: 'Context critical threshold reached (90-94%)',
|
|
611
|
+
category: ErrorCategory.CONTEXT,
|
|
612
|
+
severity: ErrorSeverity.CRITICAL,
|
|
613
|
+
retryable: false,
|
|
614
|
+
fixTemplate: 'Context usage at {percentage}%, MUST use cleo safestop now',
|
|
615
|
+
alternatives: [
|
|
616
|
+
{ action: 'Safe stop', command: 'cleo safestop' },
|
|
617
|
+
],
|
|
618
|
+
},
|
|
619
|
+
[ExitCode.E_CONTEXT_EMERGENCY]: {
|
|
620
|
+
code: 'E_CONTEXT_EMERGENCY',
|
|
621
|
+
name: 'Context Emergency',
|
|
622
|
+
description: 'Context emergency threshold reached (95%+)',
|
|
623
|
+
category: ErrorCategory.CONTEXT,
|
|
624
|
+
severity: ErrorSeverity.CRITICAL,
|
|
625
|
+
retryable: false,
|
|
626
|
+
fixTemplate: 'Context usage at {percentage}%, EMERGENCY - use cleo safestop immediately',
|
|
627
|
+
alternatives: [
|
|
628
|
+
{ action: 'Safe stop', command: 'cleo safestop' },
|
|
629
|
+
],
|
|
630
|
+
},
|
|
631
|
+
[ExitCode.E_CONTEXT_STALE]: {
|
|
632
|
+
code: 'E_CONTEXT_STALE',
|
|
633
|
+
name: 'Context Stale',
|
|
634
|
+
description: 'Context state file is stale or missing',
|
|
635
|
+
category: ErrorCategory.CONTEXT,
|
|
636
|
+
severity: ErrorSeverity.WARNING,
|
|
637
|
+
retryable: true,
|
|
638
|
+
fixTemplate: 'Context state file is stale, refresh with cleo context',
|
|
639
|
+
},
|
|
640
|
+
// Protocol Violations (60-70)
|
|
641
|
+
[ExitCode.E_PROTOCOL_RESEARCH]: {
|
|
642
|
+
code: 'E_PROTOCOL_RESEARCH',
|
|
643
|
+
name: 'Research Protocol Violation',
|
|
644
|
+
description: 'Research protocol requirements not met',
|
|
645
|
+
category: ErrorCategory.PROTOCOL,
|
|
646
|
+
severity: ErrorSeverity.ERROR,
|
|
647
|
+
retryable: true,
|
|
648
|
+
fixTemplate: 'Fix research protocol violations: {violations}',
|
|
649
|
+
documentation: 'protocols/research.md',
|
|
650
|
+
},
|
|
651
|
+
[ExitCode.E_PROTOCOL_CONSENSUS]: {
|
|
652
|
+
code: 'E_PROTOCOL_CONSENSUS',
|
|
653
|
+
name: 'Consensus Protocol Violation',
|
|
654
|
+
description: 'Consensus protocol requirements not met',
|
|
655
|
+
category: ErrorCategory.PROTOCOL,
|
|
656
|
+
severity: ErrorSeverity.ERROR,
|
|
657
|
+
retryable: true,
|
|
658
|
+
fixTemplate: 'Fix consensus protocol violations: {violations}',
|
|
659
|
+
documentation: 'protocols/consensus.md',
|
|
660
|
+
},
|
|
661
|
+
[ExitCode.E_PROTOCOL_SPECIFICATION]: {
|
|
662
|
+
code: 'E_PROTOCOL_SPECIFICATION',
|
|
663
|
+
name: 'Specification Protocol Violation',
|
|
664
|
+
description: 'Specification protocol requirements not met',
|
|
665
|
+
category: ErrorCategory.PROTOCOL,
|
|
666
|
+
severity: ErrorSeverity.ERROR,
|
|
667
|
+
retryable: true,
|
|
668
|
+
fixTemplate: 'Fix specification protocol violations: {violations}',
|
|
669
|
+
documentation: 'protocols/specification.md',
|
|
670
|
+
},
|
|
671
|
+
[ExitCode.E_PROTOCOL_DECOMPOSITION]: {
|
|
672
|
+
code: 'E_PROTOCOL_DECOMPOSITION',
|
|
673
|
+
name: 'Decomposition Protocol Violation',
|
|
674
|
+
description: 'Decomposition protocol requirements not met',
|
|
675
|
+
category: ErrorCategory.PROTOCOL,
|
|
676
|
+
severity: ErrorSeverity.ERROR,
|
|
677
|
+
retryable: true,
|
|
678
|
+
fixTemplate: 'Fix decomposition protocol violations: {violations}',
|
|
679
|
+
documentation: 'protocols/decomposition.md',
|
|
680
|
+
},
|
|
681
|
+
[ExitCode.E_PROTOCOL_IMPLEMENTATION]: {
|
|
682
|
+
code: 'E_PROTOCOL_IMPLEMENTATION',
|
|
683
|
+
name: 'Implementation Protocol Violation',
|
|
684
|
+
description: 'Implementation protocol requirements not met',
|
|
685
|
+
category: ErrorCategory.PROTOCOL,
|
|
686
|
+
severity: ErrorSeverity.ERROR,
|
|
687
|
+
retryable: false,
|
|
688
|
+
fixTemplate: 'Fix implementation protocol violations: {violations}',
|
|
689
|
+
documentation: 'protocols/implementation.md',
|
|
690
|
+
},
|
|
691
|
+
[ExitCode.E_PROTOCOL_CONTRIBUTION]: {
|
|
692
|
+
code: 'E_PROTOCOL_CONTRIBUTION',
|
|
693
|
+
name: 'Contribution Protocol Violation',
|
|
694
|
+
description: 'Contribution protocol requirements not met',
|
|
695
|
+
category: ErrorCategory.PROTOCOL,
|
|
696
|
+
severity: ErrorSeverity.ERROR,
|
|
697
|
+
retryable: false,
|
|
698
|
+
fixTemplate: 'Fix contribution protocol violations: {violations}',
|
|
699
|
+
documentation: 'protocols/contribution.md',
|
|
700
|
+
},
|
|
701
|
+
[ExitCode.E_PROTOCOL_RELEASE]: {
|
|
702
|
+
code: 'E_PROTOCOL_RELEASE',
|
|
703
|
+
name: 'Release Protocol Violation',
|
|
704
|
+
description: 'Release protocol requirements not met',
|
|
705
|
+
category: ErrorCategory.PROTOCOL,
|
|
706
|
+
severity: ErrorSeverity.ERROR,
|
|
707
|
+
retryable: false,
|
|
708
|
+
fixTemplate: 'Fix release protocol violations: {violations}',
|
|
709
|
+
documentation: 'protocols/release.md',
|
|
710
|
+
},
|
|
711
|
+
[ExitCode.E_PROTOCOL_GENERIC]: {
|
|
712
|
+
code: 'E_PROTOCOL_GENERIC',
|
|
713
|
+
name: 'Generic Protocol Violation',
|
|
714
|
+
description: 'Generic protocol violation or unknown protocol type',
|
|
715
|
+
category: ErrorCategory.PROTOCOL,
|
|
716
|
+
severity: ErrorSeverity.ERROR,
|
|
717
|
+
retryable: false,
|
|
718
|
+
fixTemplate: 'Fix protocol violations: {violations}',
|
|
719
|
+
},
|
|
720
|
+
[ExitCode.E_PROTOCOL_VALIDATION]: {
|
|
721
|
+
code: 'E_PROTOCOL_VALIDATION',
|
|
722
|
+
name: 'Validation Protocol Violation',
|
|
723
|
+
description: 'Validation protocol requirements not met',
|
|
724
|
+
category: ErrorCategory.PROTOCOL,
|
|
725
|
+
severity: ErrorSeverity.ERROR,
|
|
726
|
+
retryable: false,
|
|
727
|
+
fixTemplate: 'Fix validation protocol violations: {violations}',
|
|
728
|
+
documentation: 'protocols/validation.md',
|
|
729
|
+
},
|
|
730
|
+
[ExitCode.E_TESTS_SKIPPED]: {
|
|
731
|
+
code: 'E_TESTS_SKIPPED',
|
|
732
|
+
name: 'Tests Skipped',
|
|
733
|
+
description: 'Tests not run or incomplete',
|
|
734
|
+
category: ErrorCategory.PROTOCOL,
|
|
735
|
+
severity: ErrorSeverity.ERROR,
|
|
736
|
+
retryable: false,
|
|
737
|
+
fixTemplate: 'Run complete test suite: cleo test run',
|
|
738
|
+
alternatives: [
|
|
739
|
+
{ action: 'Run tests', command: 'cleo test run' },
|
|
740
|
+
{ action: 'Check test status', command: 'cleo test status' },
|
|
741
|
+
],
|
|
742
|
+
},
|
|
743
|
+
[ExitCode.E_COVERAGE_INSUFFICIENT]: {
|
|
744
|
+
code: 'E_COVERAGE_INSUFFICIENT',
|
|
745
|
+
name: 'Coverage Insufficient',
|
|
746
|
+
description: 'Test coverage below threshold',
|
|
747
|
+
category: ErrorCategory.PROTOCOL,
|
|
748
|
+
severity: ErrorSeverity.ERROR,
|
|
749
|
+
retryable: false,
|
|
750
|
+
fixTemplate: 'Increase test coverage to meet threshold',
|
|
751
|
+
alternatives: [
|
|
752
|
+
{ action: 'View coverage', command: 'cleo test coverage' },
|
|
753
|
+
],
|
|
754
|
+
},
|
|
755
|
+
// Nexus Errors (71-79)
|
|
756
|
+
[ExitCode.E_NEXUS_NOT_INITIALIZED]: {
|
|
757
|
+
code: 'E_NEXUS_NOT_INITIALIZED',
|
|
758
|
+
name: 'Nexus Not Initialized',
|
|
759
|
+
description: 'Nexus not initialized',
|
|
760
|
+
category: ErrorCategory.NEXUS,
|
|
761
|
+
severity: ErrorSeverity.ERROR,
|
|
762
|
+
retryable: false,
|
|
763
|
+
fixTemplate: 'Initialize Nexus: cleo nexus init',
|
|
764
|
+
},
|
|
765
|
+
[ExitCode.E_NEXUS_PROJECT_NOT_FOUND]: {
|
|
766
|
+
code: 'E_NEXUS_PROJECT_NOT_FOUND',
|
|
767
|
+
name: 'Nexus Project Not Found',
|
|
768
|
+
description: 'Project not found in global registry',
|
|
769
|
+
category: ErrorCategory.NEXUS,
|
|
770
|
+
severity: ErrorSeverity.ERROR,
|
|
771
|
+
retryable: false,
|
|
772
|
+
fixTemplate: 'Register project: cleo nexus register {projectPath}',
|
|
773
|
+
},
|
|
774
|
+
[ExitCode.E_NEXUS_PERMISSION_DENIED]: {
|
|
775
|
+
code: 'E_NEXUS_PERMISSION_DENIED',
|
|
776
|
+
name: 'Nexus Permission Denied',
|
|
777
|
+
description: 'Insufficient permission for cross-project operation',
|
|
778
|
+
category: ErrorCategory.NEXUS,
|
|
779
|
+
severity: ErrorSeverity.ERROR,
|
|
780
|
+
retryable: false,
|
|
781
|
+
fixTemplate: 'Check Nexus permissions for project {projectName}',
|
|
782
|
+
},
|
|
783
|
+
[ExitCode.E_NEXUS_INVALID_SYNTAX]: {
|
|
784
|
+
code: 'E_NEXUS_INVALID_SYNTAX',
|
|
785
|
+
name: 'Nexus Invalid Syntax',
|
|
786
|
+
description: 'Invalid task reference syntax',
|
|
787
|
+
category: ErrorCategory.NEXUS,
|
|
788
|
+
severity: ErrorSeverity.ERROR,
|
|
789
|
+
retryable: false,
|
|
790
|
+
fixTemplate: 'Use format: project:task_id (e.g., "myproject:T123")',
|
|
791
|
+
},
|
|
792
|
+
[ExitCode.E_NEXUS_SYNC_FAILED]: {
|
|
793
|
+
code: 'E_NEXUS_SYNC_FAILED',
|
|
794
|
+
name: 'Nexus Sync Failed',
|
|
795
|
+
description: 'Failed to sync project metadata',
|
|
796
|
+
category: ErrorCategory.NEXUS,
|
|
797
|
+
severity: ErrorSeverity.ERROR,
|
|
798
|
+
retryable: true,
|
|
799
|
+
fixTemplate: 'Retry Nexus sync: cleo nexus sync',
|
|
800
|
+
},
|
|
801
|
+
[ExitCode.E_NEXUS_REGISTRY_CORRUPT]: {
|
|
802
|
+
code: 'E_NEXUS_REGISTRY_CORRUPT',
|
|
803
|
+
name: 'Nexus Registry Corrupt',
|
|
804
|
+
description: 'Nexus registry file corrupted or invalid',
|
|
805
|
+
category: ErrorCategory.NEXUS,
|
|
806
|
+
severity: ErrorSeverity.CRITICAL,
|
|
807
|
+
retryable: false,
|
|
808
|
+
fixTemplate: 'Restore from backup: cleo nexus restore',
|
|
809
|
+
},
|
|
810
|
+
[ExitCode.E_NEXUS_PROJECT_EXISTS]: {
|
|
811
|
+
code: 'E_NEXUS_PROJECT_EXISTS',
|
|
812
|
+
name: 'Nexus Project Exists',
|
|
813
|
+
description: 'Project already registered in Nexus',
|
|
814
|
+
category: ErrorCategory.NEXUS,
|
|
815
|
+
severity: ErrorSeverity.ERROR,
|
|
816
|
+
retryable: false,
|
|
817
|
+
fixTemplate: 'Project already registered: {projectName}',
|
|
818
|
+
},
|
|
819
|
+
[ExitCode.E_NEXUS_QUERY_FAILED]: {
|
|
820
|
+
code: 'E_NEXUS_QUERY_FAILED',
|
|
821
|
+
name: 'Nexus Query Failed',
|
|
822
|
+
description: 'Cross-project query operation failed',
|
|
823
|
+
category: ErrorCategory.NEXUS,
|
|
824
|
+
severity: ErrorSeverity.ERROR,
|
|
825
|
+
retryable: true,
|
|
826
|
+
fixTemplate: 'Retry query: {query}',
|
|
827
|
+
},
|
|
828
|
+
[ExitCode.E_NEXUS_GRAPH_ERROR]: {
|
|
829
|
+
code: 'E_NEXUS_GRAPH_ERROR',
|
|
830
|
+
name: 'Nexus Graph Error',
|
|
831
|
+
description: 'Graph operation error',
|
|
832
|
+
category: ErrorCategory.NEXUS,
|
|
833
|
+
severity: ErrorSeverity.ERROR,
|
|
834
|
+
retryable: true,
|
|
835
|
+
fixTemplate: 'Rebuild Nexus graph: cleo nexus rebuild',
|
|
836
|
+
},
|
|
837
|
+
// Lifecycle Enforcement Errors (80-84)
|
|
838
|
+
[ExitCode.E_LIFECYCLE_GATE_FAILED]: {
|
|
839
|
+
code: 'E_LIFECYCLE_GATE_FAILED',
|
|
840
|
+
name: 'Lifecycle Gate Failed',
|
|
841
|
+
description: 'Lifecycle gate requirements not met',
|
|
842
|
+
category: ErrorCategory.LIFECYCLE,
|
|
843
|
+
severity: ErrorSeverity.ERROR,
|
|
844
|
+
retryable: false,
|
|
845
|
+
fixTemplate: 'Complete prerequisite stages: {missingStages}',
|
|
846
|
+
alternatives: [
|
|
847
|
+
{ action: 'Check lifecycle status', command: 'cleo lifecycle status {taskId}' },
|
|
848
|
+
{ action: 'View prerequisites', command: 'cleo lifecycle prerequisites {stage}' },
|
|
849
|
+
],
|
|
850
|
+
},
|
|
851
|
+
[ExitCode.E_AUDIT_MISSING]: {
|
|
852
|
+
code: 'E_AUDIT_MISSING',
|
|
853
|
+
name: 'Audit Missing',
|
|
854
|
+
description: 'Audit object missing or incomplete',
|
|
855
|
+
category: ErrorCategory.LIFECYCLE,
|
|
856
|
+
severity: ErrorSeverity.ERROR,
|
|
857
|
+
retryable: false,
|
|
858
|
+
fixTemplate: 'Add required audit fields: {missingFields}',
|
|
859
|
+
},
|
|
860
|
+
[ExitCode.E_CIRCULAR_VALIDATION]: {
|
|
861
|
+
code: 'E_CIRCULAR_VALIDATION',
|
|
862
|
+
name: 'Circular Validation',
|
|
863
|
+
description: 'Circular validation detected (agent validating own work)',
|
|
864
|
+
category: ErrorCategory.LIFECYCLE,
|
|
865
|
+
severity: ErrorSeverity.ERROR,
|
|
866
|
+
retryable: false,
|
|
867
|
+
fixTemplate: 'Use different agent for validation (not {creatingAgent})',
|
|
868
|
+
},
|
|
869
|
+
[ExitCode.E_LIFECYCLE_TRANSITION_INVALID]: {
|
|
870
|
+
code: 'E_LIFECYCLE_TRANSITION_INVALID',
|
|
871
|
+
name: 'Invalid Lifecycle Transition',
|
|
872
|
+
description: 'Invalid lifecycle state transition',
|
|
873
|
+
category: ErrorCategory.LIFECYCLE,
|
|
874
|
+
severity: ErrorSeverity.ERROR,
|
|
875
|
+
retryable: false,
|
|
876
|
+
fixTemplate: 'Cannot transition from {fromStage} to {toStage}',
|
|
877
|
+
},
|
|
878
|
+
[ExitCode.E_PROVENANCE_REQUIRED]: {
|
|
879
|
+
code: 'E_PROVENANCE_REQUIRED',
|
|
880
|
+
name: 'Provenance Required',
|
|
881
|
+
description: 'Provenance fields required but missing',
|
|
882
|
+
category: ErrorCategory.LIFECYCLE,
|
|
883
|
+
severity: ErrorSeverity.ERROR,
|
|
884
|
+
retryable: false,
|
|
885
|
+
fixTemplate: 'Add provenance tags: @task {taskId} to all new code',
|
|
886
|
+
},
|
|
887
|
+
// Special Codes (100+)
|
|
888
|
+
[ExitCode.E_NO_DATA]: {
|
|
889
|
+
code: 'E_NO_DATA',
|
|
890
|
+
name: 'No Data',
|
|
891
|
+
description: 'No data to process (query returned empty)',
|
|
892
|
+
category: ErrorCategory.SPECIAL,
|
|
893
|
+
severity: ErrorSeverity.INFO,
|
|
894
|
+
retryable: false,
|
|
895
|
+
fixTemplate: 'No results found for query: {query}',
|
|
896
|
+
},
|
|
897
|
+
[ExitCode.E_ALREADY_EXISTS]: {
|
|
898
|
+
code: 'E_ALREADY_EXISTS',
|
|
899
|
+
name: 'Already Exists',
|
|
900
|
+
description: 'Resource already exists (not an error)',
|
|
901
|
+
category: ErrorCategory.SPECIAL,
|
|
902
|
+
severity: ErrorSeverity.INFO,
|
|
903
|
+
retryable: false,
|
|
904
|
+
fixTemplate: 'Resource already exists: {resource}',
|
|
905
|
+
},
|
|
906
|
+
[ExitCode.E_NO_CHANGE]: {
|
|
907
|
+
code: 'E_NO_CHANGE',
|
|
908
|
+
name: 'No Change',
|
|
909
|
+
description: 'No changes needed or made (idempotent operation)',
|
|
910
|
+
category: ErrorCategory.SPECIAL,
|
|
911
|
+
severity: ErrorSeverity.INFO,
|
|
912
|
+
retryable: false,
|
|
913
|
+
fixTemplate: 'No changes made (already in target state)',
|
|
914
|
+
},
|
|
915
|
+
};
|
|
916
|
+
/**
|
|
917
|
+
* Get error mapping for exit code
|
|
918
|
+
*/
|
|
919
|
+
export function getErrorMapping(exitCode) {
|
|
920
|
+
return ERROR_MAP[exitCode] || {
|
|
921
|
+
code: 'E_UNKNOWN',
|
|
922
|
+
name: 'Unknown Error',
|
|
923
|
+
description: `Unknown exit code: ${exitCode}`,
|
|
924
|
+
category: ErrorCategory.GENERAL,
|
|
925
|
+
severity: ErrorSeverity.ERROR,
|
|
926
|
+
retryable: false,
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Check if exit code represents an error
|
|
931
|
+
*/
|
|
932
|
+
export function isError(exitCode) {
|
|
933
|
+
return exitCode >= 1 && exitCode < 100;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Check if exit code is retryable
|
|
937
|
+
*/
|
|
938
|
+
export function isRetryable(exitCode) {
|
|
939
|
+
const mapping = getErrorMapping(exitCode);
|
|
940
|
+
return mapping.retryable;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Check if exit code represents success
|
|
944
|
+
*/
|
|
945
|
+
export function isSuccess(exitCode) {
|
|
946
|
+
return exitCode === 0 || exitCode >= 100;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Generate fix command from template
|
|
950
|
+
*/
|
|
951
|
+
export function generateFixCommand(exitCode, context) {
|
|
952
|
+
const mapping = getErrorMapping(exitCode);
|
|
953
|
+
if (!mapping.fixTemplate) {
|
|
954
|
+
return undefined;
|
|
955
|
+
}
|
|
956
|
+
let fix = mapping.fixTemplate;
|
|
957
|
+
for (const [key, value] of Object.entries(context)) {
|
|
958
|
+
fix = fix.replace(`{${key}}`, value);
|
|
959
|
+
}
|
|
960
|
+
return fix;
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Generate suggestions from alternatives
|
|
964
|
+
*/
|
|
965
|
+
export function generateSuggestions(exitCode, context) {
|
|
966
|
+
const mapping = getErrorMapping(exitCode);
|
|
967
|
+
if (!mapping.alternatives) {
|
|
968
|
+
return [];
|
|
969
|
+
}
|
|
970
|
+
return mapping.alternatives.map((alt) => {
|
|
971
|
+
let command = alt.command;
|
|
972
|
+
for (const [key, value] of Object.entries(context)) {
|
|
973
|
+
command = command.replace(`{${key}}`, value);
|
|
974
|
+
}
|
|
975
|
+
return {
|
|
976
|
+
action: alt.action,
|
|
977
|
+
command,
|
|
978
|
+
};
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Exit codes that support automatic retry with exponential backoff.
|
|
983
|
+
* Per MCP-SERVER-SPECIFICATION Section 9.1.
|
|
984
|
+
*
|
|
985
|
+
* @task T3142
|
|
986
|
+
*/
|
|
987
|
+
export const RETRYABLE_EXIT_CODES = new Set([
|
|
988
|
+
ExitCode.E_LOCK_TIMEOUT, // 7
|
|
989
|
+
ExitCode.E_CHECKSUM_MISMATCH, // 20
|
|
990
|
+
ExitCode.E_CONCURRENT_MODIFICATION, // 21
|
|
991
|
+
ExitCode.E_ID_COLLISION, // 22
|
|
992
|
+
ExitCode.E_PROTOCOL_RESEARCH, // 60
|
|
993
|
+
ExitCode.E_PROTOCOL_CONSENSUS, // 61
|
|
994
|
+
ExitCode.E_PROTOCOL_SPECIFICATION, // 62
|
|
995
|
+
ExitCode.E_PROTOCOL_DECOMPOSITION, // 63
|
|
996
|
+
]);
|
|
997
|
+
/**
|
|
998
|
+
* Exit codes that require human intervention and must NEVER be retried.
|
|
999
|
+
* Per MCP-SERVER-SPECIFICATION Section 9.2.
|
|
1000
|
+
*
|
|
1001
|
+
* @task T3142
|
|
1002
|
+
*/
|
|
1003
|
+
export const NON_RECOVERABLE_EXIT_CODES = new Set([
|
|
1004
|
+
ExitCode.E_LIFECYCLE_GATE_FAILED, // 80
|
|
1005
|
+
ExitCode.E_CIRCULAR_VALIDATION, // 82
|
|
1006
|
+
ExitCode.E_LIFECYCLE_TRANSITION_INVALID, // 83
|
|
1007
|
+
ExitCode.E_PROVENANCE_REQUIRED, // 84
|
|
1008
|
+
]);
|
|
1009
|
+
/**
|
|
1010
|
+
* Check if an exit code represents a non-recoverable error
|
|
1011
|
+
* requiring human intervention. These must NEVER be retried.
|
|
1012
|
+
*
|
|
1013
|
+
* @task T3142
|
|
1014
|
+
*/
|
|
1015
|
+
export function isNonRecoverable(exitCode) {
|
|
1016
|
+
return NON_RECOVERABLE_EXIT_CODES.has(exitCode);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Check if an exit code represents a recoverable error
|
|
1020
|
+
* @param exitCode The exit code to check
|
|
1021
|
+
* @returns true if the error is retryable
|
|
1022
|
+
*/
|
|
1023
|
+
export function isRecoverable(exitCode) {
|
|
1024
|
+
// Retry codes: 7 (lock timeout), 20-22 (concurrency), 60-63 (protocol)
|
|
1025
|
+
return RETRYABLE_EXIT_CODES.has(exitCode);
|
|
1026
|
+
}
|
|
1027
|
+
//# sourceMappingURL=exit-codes.js.map
|