cli-blueprint 5.0.4 → 7.0.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/package.json CHANGED
@@ -12,11 +12,10 @@
12
12
  ],
13
13
  "license": "UNLICENSED",
14
14
  "name": "cli-blueprint",
15
- "private": false,
16
15
  "repository": {
17
16
  "type": "git",
18
17
  "url": "https://github.com/88208555/blueprint-clitax.git"
19
18
  },
20
19
  "type": "module",
21
- "version": "5.0.4"
20
+ "version": "7.0.1"
22
21
  }
package/skill/SKILL.md CHANGED
@@ -5,6 +5,8 @@ description: '把一个目标编译为可执行、可验证、可追溯的工程
5
5
 
6
6
  # Blueprint Skill
7
7
 
8
+ 版本:v6.0.0
9
+
8
10
  Endpoint: https://cli.tax/wvz6zmRWmX
9
11
  Request schema: blueprint.skill.request/1.0
10
12
  Response schema: blueprint.skill.response/1.0
@@ -49,3 +51,261 @@ After `capabilities`, read `officialCatalog`. Default allowlist is official skil
49
51
  - Never send credentials, model keys, provider endpoints, or personal secrets inside the request envelope or `input`.
50
52
  - The response `status` must be `succeeded`; a `failed` response is an error, not a result.
51
53
  - Public responses never prove that code was developed, tested, or deployed.
54
+
55
+ ## IR Schema 完整文档(v6.0.0)
56
+
57
+ ### 顶层结构
58
+
59
+ ```json
60
+ {
61
+ "schemaVersion": "blueprint.ir/1.0", // 必填,必须是这个值
62
+ "blueprintId": "string", // 必填,kebab-case
63
+ "title": "string", // 必填
64
+ "revision": 0, // 必填,非负整数(0, 1, 2...)
65
+ "entryNodeId": "string", // 必填,指向 nodes 中 entry:true 的节点
66
+ "baseline": {
67
+ "summary": "string", // 必填
68
+ "facts": [ // 必填,对象数组
69
+ {
70
+ "id": "string", // 每个 fact 必须有 id
71
+ "statement": "string", // 必填
72
+ "status": "confirmed" // 必填枚举,见下方
73
+ }
74
+ ]
75
+ },
76
+ "domains": [ // 必填
77
+ {
78
+ "id": "string",
79
+ "name": "string",
80
+ "summary": "string" // 可选
81
+ }
82
+ ],
83
+ "modules": [ // 必填
84
+ {
85
+ "id": "string", // 必填
86
+ "domainId": "string", // 必填,引用 domains.id
87
+ "name": "string"
88
+ }
89
+ ],
90
+ "nodes": [ // 必填,非空
91
+ {
92
+ "id": "string", // 注意:是 id 不是 nodeId
93
+ "entry": true, // true 标记入口节点(且仅一个)
94
+ "moduleId": "string", // 引用 modules.id
95
+ "title": "string", // 必填
96
+ "inputs": [ // 必须是命名对象数组,字符串数组被拒
97
+ { "name": "string" }
98
+ ],
99
+ "outputs": [ // 同上
100
+ { "name": "string", "exposed": true }
101
+ ],
102
+ "requirementRefs": ["string"] // 引用 baseline.facts.id
103
+ }
104
+ ],
105
+ "edges": [ // 必填
106
+ {
107
+ "id": "string",
108
+ "fromNodeId": "string", // 引用 nodes.id
109
+ "toNodeId": "string", // 引用 nodes.id
110
+ "type": "data", // 必填枚举,见下方
111
+ "fromOutput": "string", // 数据边必须精确到端口名
112
+ "toInput": "string", // 数据边必须精确到端口名
113
+ "allowCycle": true, // 环边必须 true
114
+ "loopGuard": "string", // 环边必须有文字说明
115
+ "loopLimit": { // 环边必须有迭代上限
116
+ "maxIterations": 10
117
+ }
118
+ }
119
+ ],
120
+ "acceptanceCriteria": [ // 必填
121
+ {
122
+ "id": "string",
123
+ "statement": "string",
124
+ "nodeRefs": ["string"] // 引用 nodes.id,无 nodeRefs 视为未链接(P1)
125
+ }
126
+ ]
127
+ }
128
+ ```
129
+
130
+ ### 字段枚举值
131
+
132
+ **fact.status**:`"confirmed"` | `"inferred"` | `"defaulted"` | `"unknown"` | `"conflicted"` | `"rejected"`
133
+
134
+ **edge.type**:`"data"` | `"control"` | `"success"` | `"error"` | `"trace"` | `"event"` | `"approval"` | `"recovery"` | `"audit"` | `"optional"` | `"compensation"`
135
+
136
+ > ⚠️ `"depends-on"` 不被接受,必须使用上述合法枚举值。
137
+
138
+ ### 校验规则
139
+
140
+ - **节点覆盖**:每个节点必须被至少一条 acceptanceCriteria 覆盖(通过 `nodeRefs`)
141
+ - **事实追溯**:每个 fact 必须追溯到节点(通过 `nodes.requirementRefs`)
142
+ - **入口节点**:仅一个节点 `entry: true`,且必须是 `entryNodeId` 指向的节点
143
+ - **数据边**:必须 `fromOutput` / `toInput` 精确匹配端口名
144
+ - **控制边**:不需要端口级连线
145
+ - **环边**:`type` 必须是 `"control"` 或 `"optional"`,必须同时包含 `allowCycle: true` + `loopGuard`(文字说明)+ `loopLimit`(含 `maxIterations` 数字)
146
+
147
+ ### 最小合法示例
148
+
149
+ ```json
150
+ {
151
+ "schemaVersion": "blueprint.ir/1.0",
152
+ "blueprintId": "demo-pipeline",
153
+ "title": "Demo Pipeline",
154
+ "revision": 0,
155
+ "entryNodeId": "step-a",
156
+ "baseline": {
157
+ "summary": "A minimal 2-node linear pipeline",
158
+ "facts": [
159
+ {
160
+ "id": "f-input",
161
+ "statement": "System must accept user input",
162
+ "status": "confirmed"
163
+ }
164
+ ]
165
+ },
166
+ "domains": [
167
+ {
168
+ "id": "d-core",
169
+ "name": "Core"
170
+ }
171
+ ],
172
+ "modules": [
173
+ {
174
+ "id": "m-impl",
175
+ "domainId": "d-core",
176
+ "name": "Implementation"
177
+ }
178
+ ],
179
+ "nodes": [
180
+ {
181
+ "id": "step-a",
182
+ "entry": true,
183
+ "moduleId": "m-impl",
184
+ "title": "Step A – Receive Input",
185
+ "inputs": [],
186
+ "outputs": [
187
+ { "name": "data" }
188
+ ],
189
+ "requirementRefs": ["f-input"]
190
+ },
191
+ {
192
+ "id": "step-b",
193
+ "moduleId": "m-impl",
194
+ "title": "Step B – Process",
195
+ "inputs": [
196
+ { "name": "data" }
197
+ ],
198
+ "outputs": []
199
+ }
200
+ ],
201
+ "edges": [
202
+ {
203
+ "id": "e-a-to-b",
204
+ "fromNodeId": "step-a",
205
+ "toNodeId": "step-b",
206
+ "type": "data",
207
+ "fromOutput": "data",
208
+ "toInput": "data"
209
+ }
210
+ ],
211
+ "acceptanceCriteria": [
212
+ {
213
+ "id": "ac-step-a",
214
+ "statement": "Input is received and forwarded",
215
+ "nodeRefs": ["step-a"]
216
+ },
217
+ {
218
+ "id": "ac-step-b",
219
+ "statement": "Processing completes successfully",
220
+ "nodeRefs": ["step-b"]
221
+ }
222
+ ]
223
+ }
224
+ ```
225
+
226
+ ## 粗粒度模式(Coarse Mode)
227
+
228
+ 在请求 `input` 中设置 `coarseMode: true` 即可启用粗粒度模式:
229
+
230
+ ```json
231
+ {
232
+ "input": {
233
+ "schemaVersion": "blueprint.skill.request/1.0",
234
+ "requestId": "unique-id",
235
+ "operation": "compile-inline",
236
+ "coarseMode": true,
237
+ "input": { "blueprint": { ... } }
238
+ }
239
+ }
240
+ ```
241
+
242
+ 启用后的行为差异:
243
+
244
+ - **节点端口可省略**:`inputs` 和 `outputs` 可以为空数组 `[]`,无需声明具体端口
245
+ - **边无需端口级连线**:`edges` 中不提供 `fromOutput` / `toInput` 仍可通过校验,节点级连接即满足输入源 / 输出消费检查
246
+ - **端口校验仅在显式声明时生效**:只有当节点明确声明了 `inputs` 或 `outputs`(非空数组)时,才强制要求数据边绑定端口名
247
+ - **适用场景**:推荐用于单文件、单实现者的快速原型场景,无需声明详细端口拓扑
248
+
249
+ ## 新操作文档
250
+
251
+ ### `acceptance-report`
252
+
253
+ 接受实施后验证结果,关闭验收标准闭环。
254
+
255
+ **输入**:
256
+
257
+ ```json
258
+ {
259
+ "blueprintId": "your-blueprint-id",
260
+ "results": [
261
+ {
262
+ "acId": "ac-step-a",
263
+ "passed": true,
264
+ "evidence": "单元测试覆盖,运行通过" // 可选,提供通过证据
265
+ },
266
+ {
267
+ "acId": "ac-step-b",
268
+ "passed": false,
269
+ "evidence": "缺少边界条件测试" // 可选,记录失败原因
270
+ }
271
+ ]
272
+ }
273
+ ```
274
+
275
+ - `blueprintId`:目标蓝图 ID
276
+ - `results`:数组,每项包含 `acId`(对应 `acceptanceCriteria.id`)、`passed`(布尔)、`evidence`(可选字符串)
277
+
278
+ ### `answer-questions`
279
+
280
+ 关闭 OPEN-QUESTIONS 循环,回答蓝图中的开放问题。
281
+
282
+ **输入**:
283
+
284
+ ```json
285
+ {
286
+ "blueprintId": "your-blueprint-id",
287
+ "answers": [
288
+ {
289
+ "questionId": "q-storage-backend",
290
+ "answer": "使用 PostgreSQL 作为持久化存储,因为团队已有运维经验"
291
+ }
292
+ ]
293
+ }
294
+ ```
295
+
296
+ - `blueprintId`:目标蓝图 ID
297
+ - `answers`:数组,每项包含 `questionId`(问题标识)和 `answer`(回答内容)
298
+
299
+ ### IR 模板
300
+
301
+ 以下是系统提供的常用 IR 模板,可作为构建蓝图的起点:
302
+
303
+ | 模板名称 | 说明 | 适用场景 |
304
+ |---------|------|---------|
305
+ | `linear-pipeline` | 线性流水线,节点依次执行 | 数据处理、ETL 任务 |
306
+ | `fan-out-fan-in` | 分叉汇聚模式,多路并行后合并 | 批量处理、并行计算 |
307
+ | `state-machine` | 状态机模式,带状态转移控制 | 流程审批、工作流引擎 |
308
+ | `event-driven` | 事件驱动模式,基于事件触发节点 | 微服务、异步任务编排 |
309
+ | `recursive-loop` | 递归循环模式,带环边与迭代守卫 | 迭代优化、爬虫、搜索 |
310
+
311
+ 使用模板时,在 `compile-inline` 的 `input` 中传入 `template: "linear-pipeline"` 即可自动填充基础结构。
package/skill/skill.json CHANGED
@@ -6,5 +6,5 @@
6
6
  "name": "blueprint",
7
7
  "schemaVersion": "blueprint.skill.request/1.0",
8
8
  "type": "Skill",
9
- "version": "v5.0.4"
10
- }
9
+ "version": "v7.0.1"
10
+ }