@miniidealab/openlogos 0.8.0 → 0.8.2

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.
Files changed (53) hide show
  1. package/codex-plugin-template/session-start.sh +1 -1
  2. package/dist/commands/change.d.ts +1 -1
  3. package/dist/commands/change.d.ts.map +1 -1
  4. package/dist/commands/change.js +54 -3
  5. package/dist/commands/change.js.map +1 -1
  6. package/dist/commands/detect.d.ts.map +1 -1
  7. package/dist/commands/detect.js +15 -1
  8. package/dist/commands/detect.js.map +1 -1
  9. package/dist/commands/init.d.ts +4 -3
  10. package/dist/commands/init.d.ts.map +1 -1
  11. package/dist/commands/init.js +18 -14
  12. package/dist/commands/init.js.map +1 -1
  13. package/dist/commands/launch.d.ts +1 -1
  14. package/dist/commands/launch.d.ts.map +1 -1
  15. package/dist/commands/launch.js +71 -16
  16. package/dist/commands/launch.js.map +1 -1
  17. package/dist/commands/module.d.ts +2 -1
  18. package/dist/commands/module.d.ts.map +1 -1
  19. package/dist/commands/module.js +29 -9
  20. package/dist/commands/module.js.map +1 -1
  21. package/dist/commands/next.d.ts +13 -1
  22. package/dist/commands/next.d.ts.map +1 -1
  23. package/dist/commands/next.js +118 -48
  24. package/dist/commands/next.js.map +1 -1
  25. package/dist/commands/status.d.ts +34 -5
  26. package/dist/commands/status.d.ts.map +1 -1
  27. package/dist/commands/status.js +270 -96
  28. package/dist/commands/status.js.map +1 -1
  29. package/dist/commands/sync.d.ts.map +1 -1
  30. package/dist/commands/sync.js +25 -4
  31. package/dist/commands/sync.js.map +1 -1
  32. package/dist/i18n.d.ts +1 -1
  33. package/dist/i18n.d.ts.map +1 -1
  34. package/dist/i18n.js +42 -22
  35. package/dist/i18n.js.map +1 -1
  36. package/dist/index.js +21 -10
  37. package/dist/index.js.map +1 -1
  38. package/dist/lib/migrate-lifecycle.d.ts +13 -0
  39. package/dist/lib/migrate-lifecycle.d.ts.map +1 -0
  40. package/dist/lib/migrate-lifecycle.js +55 -0
  41. package/dist/lib/migrate-lifecycle.js.map +1 -0
  42. package/opencode-plugin-template/commands/openlogos-launch.md +8 -3
  43. package/opencode-plugin-template/openlogos.js +10 -1
  44. package/package.json +1 -1
  45. package/skills/change-writer/SKILL.en.md +8 -1
  46. package/skills/change-writer/SKILL.md +8 -1
  47. package/skills/merge-executor/SKILL.en.md +7 -1
  48. package/skills/merge-executor/SKILL.md +9 -1
  49. package/spec/change-management.md +5 -3
  50. package/spec/cli-json-output.md +99 -12
  51. package/spec/logos-project.md +3 -6
  52. package/spec/module-naming-convention.md +2 -4
  53. package/spec/opencode-plugin.md +3 -3
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 1. 概述
6
6
 
7
- OpenLogos CLI 的 `status`、`verify`、`detect` 三个命令支持 `--format json` 参数,输出结构化 JSON 供外部工具(如 RunLogos)以编程方式消费。
7
+ OpenLogos CLI 的 `status`、`next`、`verify`、`detect` 四个命令支持 `--format json` 参数,输出结构化 JSON 供外部工具(如 RunLogos)以编程方式消费。
8
8
 
9
9
  ### 1.1 通用约定
10
10
 
@@ -21,7 +21,7 @@ OpenLogos CLI 的 `status`、`verify`、`detect` 三个命令支持 `--format js
21
21
 
22
22
  ```jsonc
23
23
  {
24
- "command": "<command-name>", // "status" | "verify" | "detect"
24
+ "command": "<command-name>", // "status" | "next" | "verify" | "detect" | "module list"
25
25
  "version": "<cli-version>", // CLI 版本号,如 "0.5.9"
26
26
  "timestamp": "<ISO-8601>", // 输出时间戳
27
27
  "data": { ... } // 命令特定的数据负载
@@ -52,7 +52,7 @@ openlogos detect --format json # JSON 格式
52
52
  "project": null | { // null 表示当前目录不是 OpenLogos 项目
53
53
  "name": "my-project", // 项目名
54
54
  "locale": "zh", // 语言设置
55
- "lifecycle": "active", // "initial" | "active"
55
+ "lifecycle": "launched", // "initial" | "launched"
56
56
  "description": "项目描述", // 项目描述
57
57
  "source_roots": null | { // 源代码根目录,null 表示未配置
58
58
  "src": ["src"], // 业务代码根目录列表
@@ -113,14 +113,37 @@ openlogos status --format json # JSON 格式
113
113
  {
114
114
  "id": "core",
115
115
  "name": "核心功能",
116
- "status": "stable",
117
- "loop_phase": null
116
+ "lifecycle": "initial", // "initial" | "launched"
117
+ "current_phase": "phase.3-2-api", // 当前推进阶段 key;launched 模块为 null
118
+ "current_phase_label": "Phase 3.2 · API 设计",
119
+ "phase_progress": { // 各阶段进度;launched 模块为 null
120
+ "phase.1": { "done": true, "skipped": false },
121
+ "phase.3-1": {
122
+ "done": false, "skipped": false,
123
+ "scenario_coverage": { "total": 3, "covered": 2, "missing": ["S03"] }
124
+ }
125
+ },
126
+ "active_change": null, // 仅 launched 模块有值
127
+ "suggestion": "对 AI 说:「设计 API」"
118
128
  },
119
129
  {
120
130
  "id": "payment",
121
131
  "name": "支付模块",
122
- "status": "in-progress",
123
- "loop_phase": "api-design"
132
+ "lifecycle": "launched",
133
+ "current_phase": null,
134
+ "current_phase_label": null,
135
+ "phase_progress": null,
136
+ "active_change": { // 当前活跃变更提案
137
+ "slug": "add-refund",
138
+ "proposal_step": "implementing", // "writing"|"implementing"|"in-progress"|"ready-to-merge"
139
+ "proposal_step_label": "实现中",
140
+ "has_proposal": true,
141
+ "has_tasks": true,
142
+ "tasks_checked": 2,
143
+ "tasks_total": 5,
144
+ "delta_count": 1
145
+ },
146
+ "suggestion": "继续实现 add-refund,完成后明确授权执行 openlogos merge add-refund"
124
147
  }
125
148
  ],
126
149
  "active_proposals": [
@@ -134,7 +157,7 @@ openlogos status --format json # JSON 格式
134
157
  "current_phase": "phase.2", // 第一个未完成 phase 的 key,若全部完成则为 null
135
158
  "suggestion": "对 AI 说:「基于需求文档做产品设计」", // 建议的下一步操作
136
159
  "all_done": false, // 是否所有 phase 都已完成
137
- "lifecycle": "active", // 项目生命周期
160
+ "lifecycle": "launched", // 项目生命周期,派生值:"initial" | "launched"
138
161
  "source_roots": null | { // 源代码根目录,null 表示未配置
139
162
  "src": ["src"],
140
163
  "test": ["test"]
@@ -155,8 +178,23 @@ openlogos status --format json # JSON 格式
155
178
  | `modules` | array | 否 | 模块注册表;`logos-project.yaml` 无 `modules[]` 时省略此字段(向下兼容) |
156
179
  | `modules[].id` | string | 是 | 模块标识符 |
157
180
  | `modules[].name` | string | 是 | 模块名称 |
158
- | `modules[].status` | string | 是 | 模块状态:`in-progress` 或 `stable` |
159
- | `modules[].loop_phase` | string \| null | 是 | 当前所处阶段;`stable` 模块为 null |
181
+ | `modules[].lifecycle` | string | 是 | 模块生命周期:`"initial"` 或 `"launched"` |
182
+ | `modules[].current_phase` | string \| null | 是 | 当前推进阶段 key;`launched` 模块为 null |
183
+ | `modules[].current_phase_label` | string \| null | 是 | 当前阶段本地化标签;`launched` 模块为 null |
184
+ | `modules[].phase_progress` | object \| null | 是 | 各阶段进度 map(key = phase key);`launched` 模块为 null |
185
+ | `modules[].phase_progress[key].done` | boolean | 是 | 该阶段是否已完成 |
186
+ | `modules[].phase_progress[key].skipped` | boolean | 是 | 该阶段是否被跳过 |
187
+ | `modules[].phase_progress[key].scenario_coverage` | object \| undefined | 否 | 仅场景类阶段(`phase.3-1`、`phase.3-3a`)存在 |
188
+ | `modules[].active_change` | object \| null | 是 | 当前活跃变更提案;`initial` 模块或无活跃提案时为 null |
189
+ | `modules[].active_change.slug` | string | 是 | 提案 slug |
190
+ | `modules[].active_change.proposal_step` | string | 是 | 提案阶段:`"writing"` \| `"implementing"` \| `"in-progress"` \| `"ready-to-merge"` |
191
+ | `modules[].active_change.proposal_step_label` | string | 是 | 提案阶段本地化标签 |
192
+ | `modules[].active_change.has_proposal` | boolean | 是 | 是否存在 proposal.md |
193
+ | `modules[].active_change.has_tasks` | boolean | 是 | 是否存在 tasks.md |
194
+ | `modules[].active_change.tasks_checked` | number | 是 | 已勾选任务数 |
195
+ | `modules[].active_change.tasks_total` | number | 是 | 总任务数 |
196
+ | `modules[].active_change.delta_count` | number | 是 | deltas 目录下的文件数 |
197
+ | `modules[].suggestion` | string | 是 | 针对该模块的下一步建议(本地化文本) |
160
198
  | `active_proposals` | array | 是 | 活跃变更提案列表 |
161
199
  | `active_proposals[].name` | string | 是 | 提案目录名 |
162
200
  | `active_proposals[].has_proposal` | boolean | 是 | 是否存在 proposal.md |
@@ -165,7 +203,7 @@ openlogos status --format json # JSON 格式
165
203
  | `current_phase` | string \| null | 是 | 当前应推进的阶段 key;全部完成时为 null |
166
204
  | `suggestion` | string | 是 | 建议的下一步操作(本地化文本) |
167
205
  | `all_done` | boolean | 是 | 是否全部阶段已完成(skipped 阶段不阻塞) |
168
- | `lifecycle` | string | 是 | 项目生命周期(`initial` 或 `active`) |
206
+ | `lifecycle` | string | 是 | 项目生命周期(`initial` 或 `launched`,由模块状态派生) |
169
207
  | `source_roots` | object \| null | 是 | 源代码根目录配置;未配置时为 null |
170
208
 
171
209
  ---
@@ -293,7 +331,50 @@ openlogos verify --format json # JSON 格式
293
331
 
294
332
  ---
295
333
 
296
- ## 6. 完整用法示例
334
+ ## 6. `openlogos module list --format json`
335
+
336
+ 列出项目中注册的所有模块及其生命周期状态。
337
+
338
+ ### 6.1 用法
339
+
340
+ ```bash
341
+ openlogos module list # 人类可读格式
342
+ openlogos module list --format json # JSON 格式
343
+ ```
344
+
345
+ ### 6.2 JSON Schema(data 部分)
346
+
347
+ ```jsonc
348
+ {
349
+ "modules": [
350
+ {
351
+ "id": "core",
352
+ "name": "核心功能",
353
+ "lifecycle": "initial" // "initial" | "launched"
354
+ },
355
+ {
356
+ "id": "payment",
357
+ "name": "支付模块",
358
+ "lifecycle": "launched"
359
+ }
360
+ ]
361
+ }
362
+ ```
363
+
364
+ ### 6.3 字段说明
365
+
366
+ | 字段 | 类型 | 必填 | 说明 |
367
+ |------|------|------|------|
368
+ | `modules` | array | 是 | 模块列表(与 `logos-project.yaml` 中的顺序一致) |
369
+ | `modules[].id` | string | 是 | 模块标识符(小写字母/数字/连字符) |
370
+ | `modules[].name` | string | 是 | 模块名称 |
371
+ | `modules[].lifecycle` | string | 是 | 模块生命周期:`"initial"` 或 `"launched"` |
372
+
373
+ > 若项目未注册任何模块,`modules` 为空数组 `[]`,不报错。
374
+
375
+ ---
376
+
377
+ ## 7. 完整用法示例
297
378
 
298
379
  ```bash
299
380
  # 获取项目状态(机器可读)
@@ -305,6 +386,12 @@ openlogos detect --format json | jq '.data.cli.version'
305
386
  # 获取测试验收摘要
306
387
  openlogos verify --format json | jq '.data.gate.result'
307
388
 
389
+ # 列出所有模块的生命周期
390
+ openlogos module list --format json | jq '.data.modules[] | {id, lifecycle}'
391
+
392
+ # 在脚本中检查是否有 launched 模块
393
+ openlogos module list --format json | jq -e '.data.modules | any(.lifecycle == "launched")'
394
+
308
395
  # 在脚本中检查门禁结果
309
396
  if openlogos verify --format json 2>/dev/null | jq -e '.data.gate.result == "PASS"' > /dev/null; then
310
397
  echo "All tests passed!"
@@ -82,8 +82,7 @@
82
82
  |------|------|------|------|
83
83
  | `id` | string | 是 | 模块标识符,小写字母 + 连字符,如 `core`、`payment` |
84
84
  | `name` | string | 是 | 模块名称(中文或英文均可) |
85
- | `status` | string | 是 | 模块状态:`in-progress`(推进中)或 `stable`(已稳定) |
86
- | `loop_phase` | string\|null | 是 | 当前所处阶段(如 `api-design`、`scenario-modeling`);`stable` 模块设为 `null` |
85
+ | `lifecycle` | string | 是 | 模块生命周期:`initial`(初始开发阶段,关注 phase 推进)或 `launched`(迭代开发阶段,关注变更提案) |
87
86
 
88
87
  ### resource_index
89
88
 
@@ -143,12 +142,10 @@ scenario_counter:
143
142
  modules:
144
143
  - id: core
145
144
  name: 核心功能
146
- status: stable
147
- loop_phase: null
145
+ lifecycle: launched
148
146
  - id: payment
149
147
  name: 支付模块
150
- status: in-progress
151
- loop_phase: api-design
148
+ lifecycle: initial
152
149
 
153
150
  external_dependencies:
154
151
  - name: "邮件服务"
@@ -48,12 +48,10 @@ scenario_counter:
48
48
  modules:
49
49
  - id: core
50
50
  name: 核心功能
51
- status: stable
52
- loop_phase: null
51
+ lifecycle: launched
53
52
  - id: payment
54
53
  name: 支付模块
55
- status: in-progress
56
- loop_phase: api-design
54
+ lifecycle: initial
57
55
  ```
58
56
 
59
57
  ## 多模块共存示例
@@ -78,12 +78,12 @@ MVP 至少覆盖以下事件:
78
78
  | `/openlogos:merge <slug>` | `openlogos merge <slug>` | 生成合并指令 |
79
79
  | `/openlogos:archive <slug>` | `openlogos archive <slug>` | 归档变更 |
80
80
  | `/openlogos:verify` | `openlogos verify` | 执行验收 |
81
- | `/openlogos:launch` | `openlogos launch` | 激活变更管理 |
81
+ | `/openlogos:launch [module-id]` | `openlogos launch [module-id]` | 将指定模块标记为 launched,激活变更管理 |
82
82
 
83
83
  ### 命令参数契约(MVP)
84
84
 
85
- - 无参命令:`status`、`next`、`sync`、`verify`、`launch`
86
- - 可选参命令:`init [name]`
85
+ - 无参命令:`status`、`next`、`sync`、`verify`
86
+ - 可选参命令:`init [name]`、`launch [module-id]`
87
87
  - 必填参命令:`change <slug>`、`merge <slug>`、`archive <slug>`
88
88
 
89
89
  解析规则: