@minniexcode/codex-switch 0.0.11 → 0.0.12
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.AI.md +56 -98
- package/README.CN.md +90 -126
- package/README.md +63 -97
- package/dist/app/get-status.js +8 -3
- package/dist/app/list-providers.js +48 -1
- package/dist/cli/output.js +145 -18
- package/dist/commands/handlers.js +10 -6
- package/dist/commands/help.js +9 -5
- package/dist/commands/registry.js +15 -12
- package/dist/domain/runtime-state.js +30 -8
- package/dist/infra/config-repo.js +16 -206
- package/dist/interaction/interactive.js +16 -6
- package/dist/runtime/copilot-bridge.js +2 -1
- package/dist/storage/config-repo.js +0 -23
- package/docs/Design/codex-switch-v0.0.12-design.md +343 -0
- package/docs/PRD/codex-switch-prd-v0.0.12.md +279 -0
- package/docs/PRD/codex-switch-prd-v0.1.0.md +125 -237
- package/docs/Tests/testing.md +39 -112
- package/docs/cli-usage.md +138 -439
- package/docs/codex-switch-command-design.md +3 -0
- package/docs/codex-switch-product-overview.md +52 -207
- package/docs/codex-switch-technical-architecture.md +3 -0
- package/package.json +1 -1
- package/dist/app/rollback-latest.js +0 -26
|
@@ -1,135 +1,66 @@
|
|
|
1
|
-
# codex-switch `0.0
|
|
1
|
+
# codex-switch `0.1.0` Release Gate PRD
|
|
2
2
|
|
|
3
3
|
## 文档信息
|
|
4
4
|
|
|
5
|
-
- 状态:
|
|
5
|
+
- 状态:Release Gate Draft
|
|
6
6
|
- 产品名:`codex-switch`
|
|
7
7
|
- CLI 命令名:`codexs`
|
|
8
|
-
-
|
|
9
|
-
- 目标版本:`0.0
|
|
10
|
-
- 文档定位:定义 `
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- 对应研究稿:[`../codex-switch-product-research.md`](../codex-switch-product-research.md)
|
|
14
|
-
- 对应技术架构:[`../codex-switch-technical-architecture.md`](../codex-switch-technical-architecture.md)
|
|
15
|
-
- 对应命令设计:[`../codex-switch-command-design.md`](../codex-switch-command-design.md)
|
|
16
|
-
|
|
17
|
-
说明:
|
|
18
|
-
|
|
19
|
-
- 当前文件路径仍沿用历史命名 `codex-switch-prd-v0.1.0.md`
|
|
20
|
-
- 本文档内容语义以当前 active PRD 为准,本次版本更新不处理文件重命名
|
|
8
|
+
- 当前预发布基线:`0.0.12` beta
|
|
9
|
+
- 目标版本:`0.1.0`
|
|
10
|
+
- 文档定位:定义 `codex-switch` 何时可以从 `0.0.x` 进入第一个正式稳定发布版本
|
|
11
|
+
- 关联 beta PRD:[`./codex-switch-prd-v0.0.12.md`](./codex-switch-prd-v0.0.12.md)
|
|
12
|
+
- 关联长期演进稿:[`./codex-switch-prd-v0.0.5-to-v0.1.0.md`](./codex-switch-prd-v0.0.5-to-v0.1.0.md)
|
|
21
13
|
|
|
22
14
|
## 一句话定义
|
|
23
15
|
|
|
24
|
-
`0.0
|
|
25
|
-
|
|
26
|
-
## 当前基线:`0.0.5`
|
|
27
|
-
|
|
28
|
-
当前已具备的命令面:
|
|
29
|
-
|
|
30
|
-
- `config-show`
|
|
31
|
-
- `config-list-profiles`
|
|
32
|
-
- `list`
|
|
33
|
-
- `show`
|
|
34
|
-
- `current`
|
|
35
|
-
- `status`
|
|
36
|
-
- `setup`
|
|
37
|
-
- `edit`
|
|
38
|
-
- `add`
|
|
39
|
-
- `switch`
|
|
40
|
-
- `remove`
|
|
41
|
-
- `import`
|
|
42
|
-
- `export`
|
|
43
|
-
- `backups`
|
|
44
|
-
- `doctor`
|
|
45
|
-
- `rollback`
|
|
46
|
-
|
|
47
|
-
当前基线已具备的工程特征:
|
|
48
|
-
|
|
49
|
-
- `providers.json` 继续作为管理态单一事实源
|
|
50
|
-
- `config.toml` 具备结构化读取与受管 section 写入能力
|
|
51
|
-
- 写命令统一走锁、备份、失败回滚
|
|
52
|
-
- `--json` 继续使用统一 envelope
|
|
53
|
-
- CLI 帮助页已经具备稳定命令分组和文案基础
|
|
54
|
-
|
|
55
|
-
当前主要问题:
|
|
56
|
-
|
|
57
|
-
- `0.0.5` 需要继续收敛边界行为和失败语义,提升已有功能的稳定性
|
|
58
|
-
- `src/cli.ts` 已经承担过多命令分发、交互编排和参数补全逻辑
|
|
59
|
-
- 当前四层结构仍然成立,但 CLI 入口和应用编排层需要进一步细化职责
|
|
60
|
-
- 未来第三方 auth / 本地代理 / 外部依赖接入已具备现实需求,但当前扩展边界还不够明确
|
|
61
|
-
|
|
62
|
-
## `0.0.6` 目标
|
|
63
|
-
|
|
64
|
-
`0.0.6` 需要完成三件事:
|
|
65
|
-
|
|
66
|
-
- 修复 `0.0.5` 命令行为中的稳定性问题,巩固已有能力
|
|
67
|
-
- 重整 CLI 与应用层分层,解决 `cli.ts` 持续膨胀问题
|
|
68
|
-
- 为未来第三方 auth / 本地 proxy / 外部 SDK 集成建立清晰边界,但本版不交付这些集成功能
|
|
69
|
-
|
|
70
|
-
## 范围
|
|
71
|
-
|
|
72
|
-
### In Scope
|
|
73
|
-
|
|
74
|
-
- 现有命令面的稳定性修复与一致性收敛
|
|
75
|
-
- 顶层 help 文案、命令分组、示例和危险提示的一致性
|
|
76
|
-
- `--json` 契约、TTY 交互规则、非交互失败语义的一致性
|
|
77
|
-
- `setup` / `add` / `edit` / `remove` / `import` / `export` / `switch` / `rollback` 的事务与恢复稳定性
|
|
78
|
-
- `status` / `doctor` / `config-show` / `config-list-profiles` 的读取稳定性
|
|
79
|
-
- CLI 入口再分层
|
|
80
|
-
- 应用编排与运行时集成边界收敛
|
|
81
|
-
- 为未来第三方 integration 预留明确架构边界
|
|
82
|
-
|
|
83
|
-
### Out of Scope
|
|
16
|
+
`0.1.0` 不是“功能再多一点”的版本,而是 `codex-switch` 第一条可正式对外承诺的稳定产品线:命令入口稳定、输出契约稳定、主工作流清晰、恢复与诊断可信、文档与包内容一致。
|
|
84
17
|
|
|
85
|
-
|
|
86
|
-
- 真实 Copilot auth 登录接入
|
|
87
|
-
- 本地代理服务启动、停止、守护和生命周期管理
|
|
88
|
-
- 第三方 SDK 安装器或依赖下载体验
|
|
89
|
-
- GUI / TUI / daemon 化
|
|
90
|
-
- 把 `config.toml` 升级为通用配置编辑器
|
|
18
|
+
## 发布语义
|
|
91
19
|
|
|
92
|
-
|
|
20
|
+
一旦进入 `0.1.0`,这个版本就不再只是“作者自己知道怎么用”的工具,而需要满足:
|
|
93
21
|
|
|
94
|
-
|
|
22
|
+
- 新用户看 README 与 help 就能走通主路径
|
|
23
|
+
- 自动化调用方可以信赖 `--json` 的稳定契约
|
|
24
|
+
- direct provider 和 Copilot provider 都有明确、可解释、可恢复的工作流
|
|
25
|
+
- 文档、包内容、help、测试和实际行为是同一套事实
|
|
95
26
|
|
|
96
|
-
`0.0
|
|
27
|
+
`0.1.0` 不是自动升级目标。只有当 release gate 满足时,才允许发布。
|
|
97
28
|
|
|
98
|
-
|
|
29
|
+
## `0.1.0` 必须稳定的内容
|
|
99
30
|
|
|
100
|
-
|
|
101
|
-
codexs <command> [options]
|
|
102
|
-
codexs help <command>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
当前命令分组继续保留:
|
|
31
|
+
### 1. CLI 命令面
|
|
106
32
|
|
|
107
|
-
|
|
108
|
-
- Change Commands
|
|
109
|
-
- Diagnostics And Recovery
|
|
33
|
+
以下命令面在 `0.1.0` 时视为稳定:
|
|
110
34
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- `config-show`
|
|
114
|
-
- `config-list-profiles`
|
|
35
|
+
- `init`
|
|
36
|
+
- `login`
|
|
115
37
|
- `list`
|
|
116
38
|
- `show`
|
|
117
39
|
- `current`
|
|
118
40
|
- `status`
|
|
119
|
-
- `
|
|
120
|
-
- `
|
|
41
|
+
- `doctor`
|
|
42
|
+
- `config show`
|
|
43
|
+
- `config list-profiles`
|
|
121
44
|
- `add`
|
|
45
|
+
- `edit`
|
|
122
46
|
- `switch`
|
|
123
47
|
- `remove`
|
|
124
48
|
- `import`
|
|
125
49
|
- `export`
|
|
126
|
-
- `
|
|
127
|
-
- `
|
|
50
|
+
- `bridge start`
|
|
51
|
+
- `bridge status`
|
|
52
|
+
- `bridge stop`
|
|
53
|
+
- `backups list`
|
|
128
54
|
- `rollback`
|
|
129
55
|
|
|
130
|
-
|
|
56
|
+
说明:
|
|
131
57
|
|
|
132
|
-
|
|
58
|
+
- `setup` 可以继续保留为 deprecated entry
|
|
59
|
+
- `migrate` 可以继续保留,但其“高级 adopt 工具”定位必须明确
|
|
60
|
+
|
|
61
|
+
### 2. JSON Envelope
|
|
62
|
+
|
|
63
|
+
`--json` 顶层 envelope 在 `0.1.0` 前必须冻结为:
|
|
133
64
|
|
|
134
65
|
```json
|
|
135
66
|
{
|
|
@@ -143,175 +74,132 @@ codexs help <command>
|
|
|
143
74
|
|
|
144
75
|
要求:
|
|
145
76
|
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
- 架构重构不得破坏已有自动化消费方式
|
|
150
|
-
|
|
151
|
-
### 交互规则
|
|
152
|
-
|
|
153
|
-
交互能力继续只是 TTY 中的人类增强层,不改变自动化契约:
|
|
154
|
-
|
|
155
|
-
- `--json` 一律禁用交互
|
|
156
|
-
- 非 TTY 一律不进入交互
|
|
157
|
-
- 危险写命令继续要求显式确认或显式参数
|
|
158
|
-
- 用户取消 prompt 时不得产生文件写入
|
|
159
|
-
|
|
160
|
-
## 数据与状态边界
|
|
161
|
-
|
|
162
|
-
### `providers.json`
|
|
77
|
+
- 顶层字段不改名
|
|
78
|
+
- 顶层 shape 不重排
|
|
79
|
+
- 新信息只允许追加到 `data`、`warnings` 或 `error.details`
|
|
163
80
|
|
|
164
|
-
|
|
81
|
+
### 3. 双路径模型
|
|
165
82
|
|
|
166
|
-
|
|
167
|
-
- `apiKey` 仍按完整 managed provider 处理
|
|
168
|
-
- 不引入“半初始化 provider”作为稳定状态
|
|
83
|
+
`0.1.0` 前必须把以下边界视为正式产品 contract:
|
|
169
84
|
|
|
170
|
-
|
|
85
|
+
- tool home:
|
|
86
|
+
- `codex-switch.json`
|
|
87
|
+
- `providers.json`
|
|
88
|
+
- `backups/`
|
|
89
|
+
- `runtime/`
|
|
90
|
+
- `runtimes/`
|
|
91
|
+
- target Codex runtime:
|
|
92
|
+
- `config.toml`
|
|
93
|
+
- `auth.json`
|
|
171
94
|
|
|
172
|
-
|
|
95
|
+
其中:
|
|
173
96
|
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
- 非受管内容允许存在,但不进入通用编辑器范围
|
|
97
|
+
- `providers.json` 是管理态 SSOT
|
|
98
|
+
- `config.toml` 是受管 runtime routing 文件
|
|
99
|
+
- `auth.json` 是受管 auth projection 文件
|
|
178
100
|
|
|
179
|
-
###
|
|
101
|
+
### 4. 主工作流
|
|
180
102
|
|
|
181
|
-
|
|
103
|
+
#### Direct Provider
|
|
182
104
|
|
|
183
|
-
|
|
184
|
-
- 不是 provider registry 的事实源
|
|
185
|
-
- 不在 `0.0.6` 中扩展为第三方 auth 统一数据库
|
|
105
|
+
正式推荐路径必须清晰稳定:
|
|
186
106
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
- 参数归一化
|
|
195
|
-
- 交互分支判断
|
|
196
|
-
- 渐进式补问
|
|
197
|
-
- 输出路径拼装
|
|
198
|
-
|
|
199
|
-
这会让后续每增加一个命令或 integration,都继续把复杂度堆回 CLI 入口。
|
|
200
|
-
|
|
201
|
-
### `0.0.6` 架构调整目标
|
|
202
|
-
|
|
203
|
-
`0.0.6` 不要求彻底推翻现有分层,但要求把职责边界进一步显式化,至少收敛为下面几类模块能力:
|
|
204
|
-
|
|
205
|
-
- `Command Surface`
|
|
206
|
-
- 负责命令定义、help 文案、命令 key、参数规格、子命令分发
|
|
207
|
-
- `Interaction Layer`
|
|
208
|
-
- 负责 TTY prompt、危险确认、渐进式补问、交互取消语义
|
|
209
|
-
- `Application Use Cases`
|
|
210
|
-
- 负责单命令业务编排、跨仓储事务边界、结果契约组装
|
|
211
|
-
- `Domain Policies`
|
|
212
|
-
- 负责 provider/profile/config consistency 规则、错误码、纯规则判断
|
|
213
|
-
- `Storage Repositories`
|
|
214
|
-
- 负责 `providers.json`、`config.toml`、backups 的文件访问和持久化
|
|
215
|
-
- `Runtime Integrations`
|
|
216
|
-
- 负责 `codex` CLI 调用,以及未来第三方 auth adapter、本地 proxy runtime、外部 SDK 封装
|
|
217
|
-
|
|
218
|
-
### 架构约束
|
|
219
|
-
|
|
220
|
-
`0.0.6` 需要明确以下约束:
|
|
221
|
-
|
|
222
|
-
- 不把第三方 SDK 调用直接塞进 CLI 入口
|
|
223
|
-
- 不把 prompt 逻辑继续散落到每个命令分支内部
|
|
224
|
-
- 不让 `app` 层直接依赖终端输出细节
|
|
225
|
-
- 不让运行时集成逻辑反向污染领域规则
|
|
226
|
-
- 不因未来接入 Copilot 或其他 provider,就改变本地事务与回滚的安全语义
|
|
227
|
-
|
|
228
|
-
## `0.0.6` 稳定性要求
|
|
229
|
-
|
|
230
|
-
### 命令行为一致性
|
|
107
|
+
```bash
|
|
108
|
+
codexs init
|
|
109
|
+
codexs add <provider> --profile <name> --api-key <key>
|
|
110
|
+
codexs switch <provider>
|
|
111
|
+
codexs status
|
|
112
|
+
codexs doctor
|
|
113
|
+
```
|
|
231
114
|
|
|
232
|
-
|
|
115
|
+
#### Copilot Provider
|
|
233
116
|
|
|
234
|
-
|
|
235
|
-
- 默认文本输出与 `--json` 输出语义一致
|
|
236
|
-
- TTY 与非交互模式下的失败路径可预测
|
|
237
|
-
- 危险命令的确认规则一致
|
|
238
|
-
- 同一类错误优先映射到同一类错误码
|
|
117
|
+
正式推荐路径必须清晰稳定:
|
|
239
118
|
|
|
240
|
-
|
|
119
|
+
```bash
|
|
120
|
+
codexs init
|
|
121
|
+
codexs login copilot
|
|
122
|
+
codexs add <provider> --copilot --profile <name>
|
|
123
|
+
codexs switch <provider>
|
|
124
|
+
codexs status
|
|
125
|
+
codexs doctor
|
|
126
|
+
```
|
|
241
127
|
|
|
242
|
-
|
|
128
|
+
#### `migrate`
|
|
243
129
|
|
|
244
|
-
|
|
245
|
-
- 单次备份
|
|
246
|
-
- 单次失败整体回滚
|
|
130
|
+
`migrate` 在 `0.1.0` 可以保留,但必须满足:
|
|
247
131
|
|
|
248
|
-
|
|
132
|
+
- 产品定位明确为高级 adopt helper
|
|
133
|
+
- 不与 fresh install 主路径混淆
|
|
134
|
+
- 文档不把它写成所有用户都应先执行的默认第一步
|
|
249
135
|
|
|
250
|
-
|
|
251
|
-
- `config.toml` 已更新但 `providers.json` 未同步
|
|
252
|
-
- `auth.json` 或 active profile 因失败留在半切换状态
|
|
136
|
+
## Release Gate
|
|
253
137
|
|
|
254
|
-
|
|
138
|
+
只有以下条件全部满足,才允许发布 `0.1.0`:
|
|
255
139
|
|
|
256
|
-
|
|
140
|
+
### A. 工作流可信
|
|
257
141
|
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
- `
|
|
261
|
-
-
|
|
142
|
+
- direct provider 主路径可在 fresh tool home 下稳定走通
|
|
143
|
+
- Copilot 主路径可在 fresh tool home 下稳定走通
|
|
144
|
+
- `switch` 成功语义仍然等于 config + auth 投影都正确
|
|
145
|
+
- `rollback` 对受管写操作仍然可信
|
|
262
146
|
|
|
263
|
-
|
|
147
|
+
### B. 输出可信
|
|
264
148
|
|
|
265
|
-
|
|
149
|
+
- `--json` 读命令输出稳定
|
|
150
|
+
- 非交互模式不会意外 prompt
|
|
151
|
+
- 错误码和 issue code 对常见失败场景足够稳定
|
|
152
|
+
- `status` 与 `doctor` 输出能解释下一步修复动作
|
|
266
153
|
|
|
267
|
-
|
|
154
|
+
### C. 文档可信
|
|
268
155
|
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
156
|
+
- README、README.CN、README.AI、CLI usage、product overview、PRD、changelog 与实际行为一致
|
|
157
|
+
- 不再残留旧 `~/.codex/providers.json` / `backups/` 叙述
|
|
158
|
+
- 主路径在所有面向用户的文档中一致
|
|
272
159
|
|
|
273
|
-
|
|
160
|
+
### D. 包内容可信
|
|
274
161
|
|
|
275
|
-
|
|
162
|
+
- `npm pack --dry-run` 结果合理
|
|
163
|
+
- tarball 中包含正确的 README、LICENSE、docs、dist
|
|
164
|
+
- `codexs --help`、`codexs --version`、安装指引与 npm 包元数据一致
|
|
276
165
|
|
|
277
|
-
|
|
166
|
+
### E. 结构可信
|
|
278
167
|
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
- 不在本版锁定具体命令名、交互细节或 SDK 选型细节
|
|
168
|
+
- 不再保留明显误导性的历史目录语义
|
|
169
|
+
- 关键稳定模块有足够 JSDoc 和边界说明
|
|
170
|
+
- 新问题不再需要反复回到超大入口文件做修补
|
|
283
171
|
|
|
284
|
-
|
|
172
|
+
## 明确不要求 `0.1.0` 完成的内容
|
|
285
173
|
|
|
286
|
-
|
|
174
|
+
以下内容不是 `0.1.0` 的发布前置条件:
|
|
287
175
|
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
176
|
+
- 新 upstream
|
|
177
|
+
- GUI / TUI
|
|
178
|
+
- daemon / background supervisor
|
|
179
|
+
- plugin system
|
|
180
|
+
- 多账号平台
|
|
181
|
+
- 自动迁移旧状态
|
|
182
|
+
- `migrate` 的完整非交互产品化
|
|
183
|
+
- 通用 `config.toml` 编辑器
|
|
291
184
|
|
|
292
|
-
##
|
|
185
|
+
## 若 Release Gate 未通过
|
|
293
186
|
|
|
294
|
-
|
|
187
|
+
如果以下任一问题仍明显存在,则不应强行发布 `0.1.0`:
|
|
295
188
|
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
- 允许内部文件和模块重组,但外部 CLI 契约保持稳定
|
|
189
|
+
- 文档和行为仍有明显漂移
|
|
190
|
+
- `migrate` 与主路径仍然混淆
|
|
191
|
+
- Copilot 路径仍需要过多背景知识才能理解
|
|
192
|
+
- 回滚与诊断场景仍存在不稳定或不可解释行为
|
|
193
|
+
- 包内容、安装体验或帮助页仍像开发中工具
|
|
302
194
|
|
|
303
|
-
|
|
195
|
+
此时应继续发布:
|
|
304
196
|
|
|
305
|
-
|
|
197
|
+
- `0.0.13`
|
|
198
|
+
- `0.0.14`
|
|
199
|
+
- 其他后续 beta / rc 版本
|
|
306
200
|
|
|
307
|
-
|
|
308
|
-
- 现有命令在 TTY / 非交互 / `--json` 模式下行为稳定
|
|
309
|
-
- 读取命令对历史状态和异常状态的处理更稳,不产生明显回归
|
|
310
|
-
- 写命令继续满足锁、备份、失败回滚语义
|
|
311
|
-
- `cli.ts` 不再承担持续膨胀的主调度与交互编排复杂度
|
|
312
|
-
- 应用编排、交互层、运行时集成边界比 `0.0.5` 更清晰
|
|
313
|
-
- 为未来第三方 auth / 本地 proxy / SDK 接入预留了清楚但非侵入式的扩展边界
|
|
201
|
+
而不是为了版本号好看提前进入 `0.1.0`。
|
|
314
202
|
|
|
315
203
|
## 结论
|
|
316
204
|
|
|
317
|
-
`0.0
|
|
205
|
+
`0.1.0` 的意义,不在于“项目终于到 1.0 之前先过一个数字门槛”,而在于 `codex-switch` 首次具备了可以向外明确承诺的稳定产品边界。只有当工作流、输出、恢复、文档和包发布面都同时稳定时,这个版本号才成立。
|
package/docs/Tests/testing.md
CHANGED
|
@@ -1,127 +1,62 @@
|
|
|
1
1
|
# Testing Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Version under test: `0.0.12`
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- `tests/cli-e2e.spec.js`: built CLI entrypoint checks for user-visible command behavior and rendered output
|
|
7
|
-
- `tests/interaction.spec.js`: prompt boundary and interactive data collection behavior
|
|
8
|
-
- `tests/runtime.spec.js`: Codex runtime probing and version checks
|
|
9
|
-
- `tests/workflows.spec.js`: file-backed app workflow coverage for write operations and rollback paths
|
|
5
|
+
这份文档同时是测试说明和 beta release checklist。
|
|
10
6
|
|
|
11
|
-
##
|
|
7
|
+
## Active Suites
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- `tests/commands.spec.js`: argument parsing, help rendering, and command registry contract
|
|
10
|
+
- `tests/cli-e2e.spec.js`: built CLI help/version plus human-readable and JSON output behavior
|
|
11
|
+
- `tests/interaction.spec.js`: prompt boundaries
|
|
12
|
+
- `tests/runtime.spec.js`: runtime probing behavior
|
|
13
|
+
- `tests/workflows.spec.js`: file-backed mutation and rollback behavior
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
npm run build
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Run the full suite:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm test
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
`npm test` is not compile-only. It runs:
|
|
15
|
+
## Required Commands
|
|
26
16
|
|
|
27
17
|
```bash
|
|
28
18
|
npm run build
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Run one suite manually:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
node -e "require('./tests/cli-e2e.spec').tests[0].run()"
|
|
36
|
-
node -e "require('./tests/workflows.spec').tests[0].run()"
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Development Fixture
|
|
40
|
-
|
|
41
|
-
The repository fixture lives at:
|
|
42
|
-
|
|
43
|
-
```text
|
|
44
|
-
dev-codex/local-sandbox/
|
|
19
|
+
npm test
|
|
20
|
+
npx tsc --noEmit
|
|
21
|
+
npm pack --dry-run
|
|
45
22
|
```
|
|
46
23
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- read-oriented CLI subprocess tests point at it directly
|
|
50
|
-
- write-oriented tests copy it into a temporary directory before running mutations
|
|
51
|
-
|
|
52
|
-
Do not point destructive automation directly at `dev-codex/local-sandbox` unless you intentionally want to update the fixture.
|
|
53
|
-
|
|
54
|
-
## Built CLI Coverage
|
|
55
|
-
|
|
56
|
-
`tests/cli-e2e.spec.js` executes the built CLI entrypoint logic from `dist/` and asserts the same JSON and human-readable payloads users see.
|
|
24
|
+
## Release Checklist
|
|
57
25
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- `--help`
|
|
61
|
-
- `--version`
|
|
62
|
-
|
|
63
|
-
Covered read commands against the repository sandbox:
|
|
26
|
+
Read checks:
|
|
64
27
|
|
|
28
|
+
- built CLI `--help`
|
|
29
|
+
- built CLI `--version`
|
|
65
30
|
- `list --json`
|
|
66
|
-
- `show --json`
|
|
67
|
-
- `current --json`
|
|
68
31
|
- `status --json`
|
|
69
|
-
- `config show --json`
|
|
70
|
-
- `config list-profiles --json`
|
|
71
|
-
- `backups list --json`
|
|
72
32
|
- `doctor --json`
|
|
73
33
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- `init --json`
|
|
77
|
-
- `add --json`
|
|
78
|
-
- `add --create-profile --json`
|
|
79
|
-
- `edit --json`
|
|
80
|
-
- `switch --json`
|
|
81
|
-
- `remove --force --json`
|
|
82
|
-
- `import --json`
|
|
83
|
-
- `export --force --json`
|
|
84
|
-
- `rollback --json`
|
|
85
|
-
- `setup --json`
|
|
86
|
-
|
|
87
|
-
Covered non-interactive failure contracts:
|
|
34
|
+
Primary workflow checks:
|
|
88
35
|
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
- `
|
|
92
|
-
-
|
|
93
|
-
- `setup --json`
|
|
36
|
+
- fresh tool home direct path
|
|
37
|
+
- fresh tool home Copilot path
|
|
38
|
+
- read commands in `--json`
|
|
39
|
+
- write commands in sandbox
|
|
94
40
|
|
|
95
|
-
|
|
41
|
+
Specific `0.0.12` checks:
|
|
96
42
|
|
|
97
|
-
|
|
43
|
+
- top-level help shows direct primary workflow before `migrate`
|
|
44
|
+
- `migrate` is clearly presented as advanced adopt
|
|
45
|
+
- `setup` remains deprecation-only
|
|
46
|
+
- human-readable `init` output shows tool home, tool config, and providers registry
|
|
47
|
+
- human-readable `status` output shows tool home and target runtime
|
|
48
|
+
- human-readable `doctor` output is repair-oriented
|
|
49
|
+
- `--version` matches `package.json.version`
|
|
98
50
|
|
|
99
|
-
|
|
51
|
+
## Test Limits
|
|
100
52
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
- non-interactive `init`
|
|
104
|
-
- non-interactive `migrate` failure behavior
|
|
105
|
-
- interactive `migrate` adoption via injected runtime
|
|
106
|
-
- `add`, `edit`, `remove`
|
|
107
|
-
- `switch` plus rollback
|
|
108
|
-
- `export` and `import`
|
|
109
|
-
- auth write rollback on failure
|
|
110
|
-
|
|
111
|
-
## Fixture Rules
|
|
112
|
-
|
|
113
|
-
- Prefer `--codex-dir <temp-copy>` for all write tests.
|
|
114
|
-
- Prefer `--json` when assertions need stable output.
|
|
115
|
-
- Treat `show --json` output as sensitive because it includes unmasked API keys.
|
|
116
|
-
- If a test needs `codex login` or `codex --version`, prefer mocking the spawn layer instead of assuming an installed local binary.
|
|
117
|
-
- Keep fixture assertions focused on stable data such as provider names, active profile, backup count, and typed error codes.
|
|
53
|
+
- `login copilot` depends on SDK install, official CLI invocation, and auth recheck. Automation should distinguish mocked coverage from real-environment validation.
|
|
54
|
+
- `migrate` remains intentionally interactive for adopt detail collection. Non-interactive tests should verify the current failure contract rather than force a fake full automation path.
|
|
118
55
|
|
|
119
56
|
## Reporting Template
|
|
120
57
|
|
|
121
|
-
Use this template for release checks:
|
|
122
|
-
|
|
123
58
|
```text
|
|
124
|
-
Version under test: 0.0.
|
|
59
|
+
Version under test: 0.0.12
|
|
125
60
|
Build: PASS/FAIL
|
|
126
61
|
Suite results:
|
|
127
62
|
- commands: PASS/FAIL
|
|
@@ -130,22 +65,14 @@ Suite results:
|
|
|
130
65
|
- runtime: PASS/FAIL
|
|
131
66
|
- workflows: PASS/FAIL
|
|
132
67
|
|
|
133
|
-
|
|
134
|
-
- help/version/
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
68
|
+
Release checks:
|
|
69
|
+
- help/version: PASS/FAIL
|
|
70
|
+
- direct path: PASS/FAIL
|
|
71
|
+
- copilot path: PASS/FAIL
|
|
72
|
+
- json reads: PASS/FAIL
|
|
73
|
+
- sandbox writes: PASS/FAIL
|
|
138
74
|
|
|
139
75
|
Open risks:
|
|
140
76
|
- <risk 1>
|
|
141
77
|
- <risk 2>
|
|
142
78
|
```
|
|
143
|
-
|
|
144
|
-
## Current Gaps
|
|
145
|
-
|
|
146
|
-
Known areas that still deserve more coverage:
|
|
147
|
-
|
|
148
|
-
- true subprocess automation for interactive TTY-only flows such as prompt-driven `migrate`
|
|
149
|
-
- explicit tests for `rollback-latest`
|
|
150
|
-
- more backup corruption cases inside historical manifests
|
|
151
|
-
- docs and report snapshots should stay in sync with the current package version
|