@gluecharm-lab/easyspecs-cli 0.0.27 → 0.1.1
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/README.md +1 -1
- package/commands.md +13 -11
- package/dist/main.cjs +213 -90
- package/dist/main.cjs.map +3 -3
- package/error-code.md +75 -81
- package/package.json +1 -1
package/error-code.md
CHANGED
|
@@ -1,99 +1,91 @@
|
|
|
1
1
|
# EasySpecs CLI — error codes
|
|
2
2
|
|
|
3
|
-
Single reference for **process exit codes**, structured **`failureExitId`** subcodes, and how they appear in **`--json`** and stderr. **Normative
|
|
3
|
+
Single reference for **process exit codes**, structured **`failureExitId`** subcodes, and how they appear in **`--json`** and stderr. **Normative:** **[SRS-39](../../.gluecharm/docs/srs/srs-39.md)** (**R1.3**), **[SRS-70](../../.gluecharm/docs/srs/srs-70.md)** / **[PLAN-SRS-70](../../.gluecharm/docs/srs/PLAN-SRS-70.md)** (retired OS **5**; dedicated integers **49–83**), **[SRS-57](../../.gluecharm/docs/srs/srs-57.md)**, **[SRS-58](../../.gluecharm/docs/srs/srs-58.md)**.
|
|
4
4
|
|
|
5
|
-
**Maintenance:** When you add
|
|
5
|
+
**Maintenance:** When you add an **`OsExit`** value or change **`describeExitCode`**, update this file **in the same change** as [`src/cli/exitCodes.ts`](../../src/cli/exitCodes.ts), [`src/factory/factoryValidationFailures.ts`](../../src/factory/factoryValidationFailures.ts), and [`src/cli/failureExitRegistry.ts`](../../src/cli/failureExitRegistry.ts).
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## 1. Process exit codes (OS / `process.exit`)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
| **
|
|
18
|
-
| **
|
|
19
|
-
| **
|
|
20
|
-
| **
|
|
21
|
-
| **
|
|
22
|
-
| **
|
|
23
|
-
| **
|
|
24
|
-
| **
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
**
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| 7 | Upload or cloud sync failed — check network, project id, and session; see `error` above. |
|
|
38
|
-
| 8 | Operation was cancelled (abort/stop). |
|
|
39
|
-
| 99 | Unexpected internal CLI error — retry; if it persists, report with full stderr and `--verbose` output. |
|
|
40
|
-
|
|
41
|
-
When **`factoryFailures`** is present, **`exitMeaning`** in **`--json`** and the primary stderr summary should be driven by **`factoryFailures[0].title`** (per SRS-57 / SRS-58), not only the generic row above.
|
|
11
|
+
**Breaking (SRS-70):** The CLI **never** exits with **OS code `5`**. Former “validation / factory pipeline” outcomes use **dedicated integers** (**49–83**) so **`$?`** in CI is actionable without parsing JSON.
|
|
12
|
+
|
|
13
|
+
**`failureExitId`:** string **`{major}.{minor}`** where **`major`** is the **decimal digits of the same integer** passed to **`process.exit`**.
|
|
14
|
+
|
|
15
|
+
| Code | Meaning |
|
|
16
|
+
|:----:|--------|
|
|
17
|
+
| **0** | Success. |
|
|
18
|
+
| **2** | Usage — invalid arguments, unknown subcommand, help not applicable. |
|
|
19
|
+
| **3** | Misconfiguration — config, repo layout, prerequisites, paths. |
|
|
20
|
+
| **4** | OpenCode (agent runner) failed. |
|
|
21
|
+
| **6** | Auth — session / token / login. |
|
|
22
|
+
| **7** | Upload / cloud sync failed. |
|
|
23
|
+
| **8** | Cancelled. |
|
|
24
|
+
| **99** | Internal unexpected error. |
|
|
25
|
+
| **49** | Factory unknown / unclassified failure. |
|
|
26
|
+
| **50–58** | Generate Context — one code per pipeline phase (worktree → cloud sync). |
|
|
27
|
+
| **59** | Multiple failed generate_context phases with **distinct** phase codes in one run (rollup). |
|
|
28
|
+
| **60–64** | Context drift — validation-class drift outcomes (see §3.2). |
|
|
29
|
+
| **70–79** | `diagnose` / `context link-graph` / `run synthesis resume-*` index failures (see **PLAN-SRS-70 §2.4**). |
|
|
30
|
+
| **80** | `run synthesis` (standalone pipeline) failed. |
|
|
31
|
+
| **81–82** | `ace learn` / `ace auto-learn` failures. |
|
|
32
|
+
| **83** | `update context` factory failure. |
|
|
33
|
+
|
|
34
|
+
**SRS-61:** HTTP **`HttpApiError`** handling unchanged — may map to **3**, **6**, **7**, or **99** per existing rules.
|
|
35
|
+
|
|
36
|
+
One-line summaries for **49–83** live in **`describeExitCode`** in **`exitCodes.ts`**.
|
|
42
37
|
|
|
43
38
|
---
|
|
44
39
|
|
|
45
|
-
## 2. Structured IDs: `failureExitId`
|
|
40
|
+
## 2. Structured IDs: `failureExitId` / `validationExitId`
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
- **`failureExitId`:** required; **`major`** = OS exit for this invocation (after finalize all `factoryFailures[].exitCode` match **`process.exit`** per PLAN-SRS-58).
|
|
43
|
+
- **`validationExitId`:** legacy JSON alias; **mirrors `failureExitId`** when present (SRS-70).
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
- **`minor`** = stable integer assigned **per major** in the registry (no reuse for unrelated meanings).
|
|
51
|
-
|
|
52
|
-
**Aliases:**
|
|
53
|
-
|
|
54
|
-
- For **`exitCode === 5`**, **`validationExitId`** (SRS-57) **must** equal **`failureExitId`** on that row.
|
|
55
|
-
|
|
56
|
-
**JSON shape (each element of `factoryFailures`):**
|
|
57
|
-
|
|
58
|
-
| Field | Required | Notes |
|
|
59
|
-
|-------|----------|--------|
|
|
60
|
-
| `factory` | yes | e.g. `generate_context`, `context_drift` |
|
|
61
|
-
| `phase` | yes | Pipeline key within that factory |
|
|
62
|
-
| `exitCode` | yes | Same as top-level exit when single-cause |
|
|
63
|
-
| `failureExitId` | yes | `major.minor` |
|
|
64
|
-
| `title` | yes | Normative one-line explanation |
|
|
65
|
-
| `validationExitId` | when exit 5 | Same as `failureExitId` |
|
|
66
|
-
| `detail` | no | Technical tail |
|
|
67
|
-
| `validationSubcode` | no | Non-localized token (e.g. threshold class) |
|
|
45
|
+
**JSON `factoryFailures[]` row:** `factory`, `phase`, `exitCode`, `failureExitId`, `title`, optional `detail`, `validationSubcode`, optional `validationExitId` (duplicate).
|
|
68
46
|
|
|
69
47
|
---
|
|
70
48
|
|
|
71
|
-
## 3.
|
|
72
|
-
|
|
73
|
-
### 3.1 Generate Context
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
|
82
|
-
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
49
|
+
## 3. Tables by scope
|
|
50
|
+
|
|
51
|
+
### 3.1 Generate Context (`analysis`)
|
|
52
|
+
|
|
53
|
+
| Phase (`factoryFailures[].phase`) | OS exit | `failureExitId` (single-phase) |
|
|
54
|
+
|-----------------------------------|--------:|-------------------------------|
|
|
55
|
+
| `unknown_factory_phase` | **49** | `49.0` |
|
|
56
|
+
| `create_analysis_worktree` | **50** | `50.0` |
|
|
57
|
+
| `materialize_opencode_agents` | **51** | `51.0` |
|
|
58
|
+
| `synthesis_convergence` | **52** | `52.0` |
|
|
59
|
+
| `reference_coverage` | **53** | `53.0` |
|
|
60
|
+
| `zero_reference_remediation_convergence` | **54** | `54.0` |
|
|
61
|
+
| `reference_coverage_execution_report` | **55** | `55.0` |
|
|
62
|
+
| `link_mapping_pipeline` | **56** | `56.0` |
|
|
63
|
+
| `assemble_application_context_index` | **57** | `57.0` |
|
|
64
|
+
| `backend_context_sync` | **58** | `58.0` |
|
|
65
|
+
|
|
66
|
+
Multiple distinct failures → **`process.exit(59)`**, **`failureExitId`** `59.0`, `59.1`, …
|
|
67
|
+
|
|
68
|
+
### 3.2 Context drift (`context drift`)
|
|
69
|
+
|
|
70
|
+
[`failureExitRegistry.ts`](../../src/cli/failureExitRegistry.ts). **`INVALID_REFERENCE_PATH`** resolves to **3.1** / **3.2** via error text.
|
|
71
|
+
|
|
72
|
+
| Drift `code` | OS exit | `failureExitId` |
|
|
73
|
+
|--------------|--------:|-----------------|
|
|
74
|
+
| `INVALID_REFERENCE_PATH` (bundle) | 3 | **3.1** |
|
|
75
|
+
| `INVALID_REFERENCE_PATH` (`--index`) | 3 | **3.2** |
|
|
76
|
+
| `WORKTREE_PREP_FAILED` | 3 | **3.3** |
|
|
77
|
+
| `AGENT_FAILED` | 4 | **4.1** |
|
|
78
|
+
| `INVALID_AGENT_PAYLOAD` | 4 | **4.2** |
|
|
79
|
+
| `EMPTY_BUNDLE` | **60** | **60.0** |
|
|
80
|
+
| `UNRESOLVED_REFERENCE_ROOT` | **61** | **61.0** |
|
|
81
|
+
| `MANIFEST_FAILED` | **62** | **62.0** |
|
|
82
|
+
| `REPORT_WRITE_FAILED` | **63** | **63.0** |
|
|
83
|
+
| `INDEX_PATCH_FAILED` | **64** | **64.0** |
|
|
84
|
+
| `PROMOTE_FAILED` | 7 | **7.1** |
|
|
93
85
|
|
|
94
86
|
### 3.3 Other commands
|
|
95
87
|
|
|
96
|
-
|
|
88
|
+
See **PLAN-SRS-70 §2.4–2.6** for **`diagnose`**, **`run synthesis`**, **`ace`**, **`update context`** integers **70–83**.
|
|
97
89
|
|
|
98
90
|
---
|
|
99
91
|
|
|
@@ -101,10 +93,11 @@ Diagnostics, **`context link-graph`**, **`upload`**, etc. may exit **2–7** or
|
|
|
101
93
|
|
|
102
94
|
| File | Role |
|
|
103
95
|
|------|------|
|
|
104
|
-
| [`src/cli/exitCodes.ts`](../../src/cli/exitCodes.ts) | `ExitCode`, `describeExitCode` |
|
|
105
|
-
| [`src/factory/factoryValidationFailures.ts`](../../src/factory/factoryValidationFailures.ts) | Generate Context **`factoryFailures
|
|
96
|
+
| [`src/cli/exitCodes.ts`](../../src/cli/exitCodes.ts) | `ExitCode`, `OsExit`, `describeExitCode`, `failureExitIdFromParts`, `isSrs70FactoryOrDiagnoseExit` |
|
|
97
|
+
| [`src/factory/factoryValidationFailures.ts`](../../src/factory/factoryValidationFailures.ts) | Generate Context **`factoryFailures`**, rollup **59** |
|
|
98
|
+
| [`src/cli/failureExitRegistry.ts`](../../src/cli/failureExitRegistry.ts) | Context drift registry |
|
|
106
99
|
| [`src/cli/jsonReporter.ts`](../../src/cli/jsonReporter.ts) | JSON envelope typing |
|
|
107
|
-
| [commands.md](./commands.md) | Per-command behaviour
|
|
100
|
+
| [commands.md](./commands.md) | Per-command behaviour |
|
|
108
101
|
|
|
109
102
|
---
|
|
110
103
|
|
|
@@ -112,4 +105,5 @@ Diagnostics, **`context link-graph`**, **`upload`**, etc. may exit **2–7** or
|
|
|
112
105
|
|
|
113
106
|
| Date | Notes |
|
|
114
107
|
|------|--------|
|
|
115
|
-
| 2026-05-06 | Initial **`error-code.md
|
|
108
|
+
| 2026-05-06 | Initial **`error-code.md`**. |
|
|
109
|
+
| 2026-05-13 | **SRS-70:** retire OS **5**; document **49–83**; drift **60–64**; rollup **59**. |
|
package/package.json
CHANGED