@gluecharm-lab/easyspecs-cli 0.0.28 → 0.2.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 +7 -7
- package/commands.md +13 -13
- package/dist/main.cjs +1181 -555
- package/dist/main.cjs.map +4 -4
- package/error-code.md +79 -81
- package/package.json +1 -1
package/error-code.md
CHANGED
|
@@ -1,99 +1,95 @@
|
|
|
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–87**), **[SRS-57](../../.gluecharm/docs/srs/srs-57.md)**, **[SRS-58](../../.gluecharm/docs/srs/srs-58.md)**, **[SRS-72](../../.gluecharm/docs/srs/srs-72.md)** (readiness **84–87**).
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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–87**) 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 (after readiness; 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 (non-readiness). |
|
|
33
|
+
| **84** | **SRS-72:** OpenCode CLI not installed / not callable (`analysis`, `update context`, `context drift` readiness). |
|
|
34
|
+
| **85** | **SRS-72:** OpenCode credentials not ready (readiness gate **b**). |
|
|
35
|
+
| **86** | **SRS-72:** OpenCode default model not configured (readiness gate **c**). |
|
|
36
|
+
| **87** | **SRS-72:** Mandatory repo-root **`opencode.json`** missing under effective analysis root (readiness gate **d**). |
|
|
37
|
+
|
|
38
|
+
**SRS-61:** HTTP **`HttpApiError`** handling unchanged — may map to **3**, **6**, **7**, or **99** per existing rules.
|
|
39
|
+
|
|
40
|
+
One-line summaries for **49–87** live in **`describeExitCode`** in **`exitCodes.ts`**.
|
|
42
41
|
|
|
43
42
|
---
|
|
44
43
|
|
|
45
|
-
## 2. Structured IDs: `failureExitId`
|
|
44
|
+
## 2. Structured IDs: `failureExitId` / `validationExitId`
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
- **`failureExitId`:** required; **`major`** = OS exit for this invocation (after finalize all `factoryFailures[].exitCode` match **`process.exit`** per PLAN-SRS-58).
|
|
47
|
+
- **`validationExitId`:** legacy JSON alias; **mirrors `failureExitId`** when present (SRS-70).
|
|
48
48
|
|
|
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) |
|
|
49
|
+
**JSON `factoryFailures[]` row:** `factory`, `phase`, `exitCode`, `failureExitId`, `title`, optional `detail`, `validationSubcode`, optional `validationExitId` (duplicate).
|
|
68
50
|
|
|
69
51
|
---
|
|
70
52
|
|
|
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
|
-
|
|
53
|
+
## 3. Tables by scope
|
|
54
|
+
|
|
55
|
+
### 3.1 Generate Context (`analysis`)
|
|
56
|
+
|
|
57
|
+
| Phase (`factoryFailures[].phase`) | OS exit | `failureExitId` (single-phase) |
|
|
58
|
+
|-----------------------------------|--------:|-------------------------------|
|
|
59
|
+
| `unknown_factory_phase` | **49** | `49.0` |
|
|
60
|
+
| `create_analysis_worktree` | **50** | `50.0` |
|
|
61
|
+
| `materialize_opencode_agents` | **51** | `51.0` |
|
|
62
|
+
| `synthesis_convergence` | **52** | `52.0` |
|
|
63
|
+
| `reference_coverage` | **53** | `53.0` |
|
|
64
|
+
| `zero_reference_remediation_convergence` | **54** | `54.0` |
|
|
65
|
+
| `reference_coverage_execution_report` | **55** | `55.0` |
|
|
66
|
+
| `link_mapping_pipeline` | **56** | `56.0` |
|
|
67
|
+
| `assemble_application_context_index` | **57** | `57.0` |
|
|
68
|
+
| `backend_context_sync` | **58** | `58.0` |
|
|
69
|
+
|
|
70
|
+
Multiple distinct failures → **`process.exit(59)`**, **`failureExitId`** `59.0`, `59.1`, …
|
|
71
|
+
|
|
72
|
+
### 3.2 Context drift (`context drift`)
|
|
73
|
+
|
|
74
|
+
[`failureExitRegistry.ts`](../../src/cli/failureExitRegistry.ts). **`INVALID_REFERENCE_PATH`** resolves to **3.1** / **3.2** via error text.
|
|
75
|
+
|
|
76
|
+
| Drift `code` | OS exit | `failureExitId` |
|
|
77
|
+
|--------------|--------:|-----------------|
|
|
78
|
+
| `INVALID_REFERENCE_PATH` (bundle) | 3 | **3.1** |
|
|
79
|
+
| `INVALID_REFERENCE_PATH` (`--index`) | 3 | **3.2** |
|
|
80
|
+
| `WORKTREE_PREP_FAILED` | 3 | **3.3** |
|
|
81
|
+
| `AGENT_FAILED` | 4 | **4.1** |
|
|
82
|
+
| `INVALID_AGENT_PAYLOAD` | 4 | **4.2** |
|
|
83
|
+
| `EMPTY_BUNDLE` | **60** | **60.0** |
|
|
84
|
+
| `UNRESOLVED_REFERENCE_ROOT` | **61** | **61.0** |
|
|
85
|
+
| `MANIFEST_FAILED` | **62** | **62.0** |
|
|
86
|
+
| `REPORT_WRITE_FAILED` | **63** | **63.0** |
|
|
87
|
+
| `INDEX_PATCH_FAILED` | **64** | **64.0** |
|
|
88
|
+
| `PROMOTE_FAILED` | 7 | **7.1** |
|
|
93
89
|
|
|
94
90
|
### 3.3 Other commands
|
|
95
91
|
|
|
96
|
-
|
|
92
|
+
See **PLAN-SRS-70 §2.4–2.6** for **`diagnose`**, **`run synthesis`**, **`ace`**, **`update context`** integers **70–83**.
|
|
97
93
|
|
|
98
94
|
---
|
|
99
95
|
|
|
@@ -101,10 +97,11 @@ Diagnostics, **`context link-graph`**, **`upload`**, etc. may exit **2–7** or
|
|
|
101
97
|
|
|
102
98
|
| File | Role |
|
|
103
99
|
|------|------|
|
|
104
|
-
| [`src/cli/exitCodes.ts`](../../src/cli/exitCodes.ts) | `ExitCode`, `describeExitCode` |
|
|
105
|
-
| [`src/factory/factoryValidationFailures.ts`](../../src/factory/factoryValidationFailures.ts) | Generate Context **`factoryFailures
|
|
100
|
+
| [`src/cli/exitCodes.ts`](../../src/cli/exitCodes.ts) | `ExitCode`, `OsExit`, `describeExitCode`, `failureExitIdFromParts`, `isSrs70FactoryOrDiagnoseExit` |
|
|
101
|
+
| [`src/factory/factoryValidationFailures.ts`](../../src/factory/factoryValidationFailures.ts) | Generate Context **`factoryFailures`**, rollup **59** |
|
|
102
|
+
| [`src/cli/failureExitRegistry.ts`](../../src/cli/failureExitRegistry.ts) | Context drift registry |
|
|
106
103
|
| [`src/cli/jsonReporter.ts`](../../src/cli/jsonReporter.ts) | JSON envelope typing |
|
|
107
|
-
| [commands.md](./commands.md) | Per-command behaviour
|
|
104
|
+
| [commands.md](./commands.md) | Per-command behaviour |
|
|
108
105
|
|
|
109
106
|
---
|
|
110
107
|
|
|
@@ -112,4 +109,5 @@ Diagnostics, **`context link-graph`**, **`upload`**, etc. may exit **2–7** or
|
|
|
112
109
|
|
|
113
110
|
| Date | Notes |
|
|
114
111
|
|------|--------|
|
|
115
|
-
| 2026-05-06 | Initial **`error-code.md
|
|
112
|
+
| 2026-05-06 | Initial **`error-code.md`**. |
|
|
113
|
+
| 2026-05-13 | **SRS-70:** retire OS **5**; document **49–83**; drift **60–64**; rollup **59**. |
|
package/package.json
CHANGED