scene-capability-engine 3.6.16 → 3.6.18

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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.6.18] - 2026-03-06
11
+
12
+ ### Added
13
+ - Capability iteration UI schema now includes triad-ready candidate/score/mapping/register contracts for direct Magicball rendering.
14
+ - Magicball capability iteration docs now define triad-based inventory sorting and evaluation fields.
15
+
16
+ ## [3.6.17] - 2026-03-06
17
+
18
+ ### Added
19
+ - Capability catalog/list/search/show/match/use payloads now expose `ontology_core_ui` for direct UI badge rendering.
20
+ - Magicball capability library guide now documents direct triad badge fields for list and match views.
21
+
10
22
  ## [3.6.16] - 2026-03-06
11
23
 
12
24
  ### Added
package/README.md CHANGED
@@ -218,5 +218,5 @@ MIT. See [LICENSE](LICENSE).
218
218
 
219
219
  ---
220
220
 
221
- **Version**: 3.6.16
221
+ **Version**: 3.6.18
222
222
  **Last Updated**: 2026-03-05
package/README.zh.md CHANGED
@@ -218,5 +218,5 @@ MIT,见 [LICENSE](LICENSE)。
218
218
 
219
219
  ---
220
220
 
221
- **版本**:3.6.16
221
+ **版本**:3.6.18
222
222
  **最后更新**:2026-03-05
@@ -32,21 +32,37 @@
32
32
  "generated_at",
33
33
  "source",
34
34
  "specs",
35
- "summary"
35
+ "summary",
36
+ "ontology_scope",
37
+ "ontology_core"
36
38
  ],
37
39
  "properties": {
38
40
  "mode": {
39
41
  "const": "capability-extract"
40
42
  },
41
- "scene_id": { "type": "string" },
42
- "generated_at": { "type": "string" },
43
- "output_file": { "type": "string" },
43
+ "scene_id": {
44
+ "type": "string"
45
+ },
46
+ "generated_at": {
47
+ "type": "string"
48
+ },
49
+ "output_file": {
50
+ "type": "string"
51
+ },
44
52
  "source": {
45
53
  "type": "object",
46
- "required": ["scene_index_source", "spec_count"],
54
+ "required": [
55
+ "scene_index_source",
56
+ "spec_count"
57
+ ],
47
58
  "properties": {
48
- "scene_index_source": { "type": "string" },
49
- "spec_count": { "type": "integer", "minimum": 0 }
59
+ "scene_index_source": {
60
+ "type": "string"
61
+ },
62
+ "spec_count": {
63
+ "type": "integer",
64
+ "minimum": 0
65
+ }
50
66
  },
51
67
  "additionalProperties": false
52
68
  },
@@ -54,11 +70,21 @@
54
70
  "type": "array",
55
71
  "items": {
56
72
  "type": "object",
57
- "required": ["spec_id", "tasks_path", "task_summary"],
73
+ "required": [
74
+ "spec_id",
75
+ "tasks_path",
76
+ "task_summary"
77
+ ],
58
78
  "properties": {
59
- "spec_id": { "type": "string" },
60
- "tasks_path": { "type": "string" },
61
- "task_error": { "type": "string" },
79
+ "spec_id": {
80
+ "type": "string"
81
+ },
82
+ "tasks_path": {
83
+ "type": "string"
84
+ },
85
+ "task_error": {
86
+ "type": "string"
87
+ },
62
88
  "task_summary": {
63
89
  "type": "object",
64
90
  "required": [
@@ -70,12 +96,30 @@
70
96
  "unknown"
71
97
  ],
72
98
  "properties": {
73
- "total": { "type": "integer", "minimum": 0 },
74
- "completed": { "type": "integer", "minimum": 0 },
75
- "in_progress": { "type": "integer", "minimum": 0 },
76
- "queued": { "type": "integer", "minimum": 0 },
77
- "not_started": { "type": "integer", "minimum": 0 },
78
- "unknown": { "type": "integer", "minimum": 0 }
99
+ "total": {
100
+ "type": "integer",
101
+ "minimum": 0
102
+ },
103
+ "completed": {
104
+ "type": "integer",
105
+ "minimum": 0
106
+ },
107
+ "in_progress": {
108
+ "type": "integer",
109
+ "minimum": 0
110
+ },
111
+ "queued": {
112
+ "type": "integer",
113
+ "minimum": 0
114
+ },
115
+ "not_started": {
116
+ "type": "integer",
117
+ "minimum": 0
118
+ },
119
+ "unknown": {
120
+ "type": "integer",
121
+ "minimum": 0
122
+ }
79
123
  },
80
124
  "additionalProperties": false
81
125
  },
@@ -83,14 +127,39 @@
83
127
  "type": "array",
84
128
  "items": {
85
129
  "type": "object",
86
- "required": ["id", "title", "status"],
130
+ "required": [
131
+ "id",
132
+ "title",
133
+ "status"
134
+ ],
87
135
  "properties": {
88
- "id": { "type": "string" },
89
- "title": { "type": "string" },
90
- "status": { "type": "string" }
136
+ "id": {
137
+ "type": "string"
138
+ },
139
+ "title": {
140
+ "type": "string"
141
+ },
142
+ "status": {
143
+ "type": "string"
144
+ }
91
145
  },
92
146
  "additionalProperties": false
93
147
  }
148
+ },
149
+ "ontology_scope": {
150
+ "$ref": "#/definitions/ontology_scope"
151
+ },
152
+ "ontology_source": {
153
+ "type": [
154
+ "string",
155
+ "null"
156
+ ]
157
+ },
158
+ "ontology_error": {
159
+ "type": [
160
+ "string",
161
+ "null"
162
+ ]
94
163
  }
95
164
  },
96
165
  "additionalProperties": false
@@ -98,14 +167,54 @@
98
167
  },
99
168
  "summary": {
100
169
  "type": "object",
101
- "required": ["spec_count", "task_total", "task_completed", "task_pending"],
170
+ "required": [
171
+ "spec_count",
172
+ "task_total",
173
+ "task_completed",
174
+ "task_pending",
175
+ "ontology_triads_ready",
176
+ "ontology_triads_coverage_ratio",
177
+ "ontology_missing_triads"
178
+ ],
102
179
  "properties": {
103
- "spec_count": { "type": "integer", "minimum": 0 },
104
- "task_total": { "type": "integer", "minimum": 0 },
105
- "task_completed": { "type": "integer", "minimum": 0 },
106
- "task_pending": { "type": "integer", "minimum": 0 }
180
+ "spec_count": {
181
+ "type": "integer",
182
+ "minimum": 0
183
+ },
184
+ "task_total": {
185
+ "type": "integer",
186
+ "minimum": 0
187
+ },
188
+ "task_completed": {
189
+ "type": "integer",
190
+ "minimum": 0
191
+ },
192
+ "task_pending": {
193
+ "type": "integer",
194
+ "minimum": 0
195
+ },
196
+ "ontology_triads_ready": {
197
+ "type": "boolean"
198
+ },
199
+ "ontology_triads_coverage_ratio": {
200
+ "type": "number",
201
+ "minimum": 0,
202
+ "maximum": 1
203
+ },
204
+ "ontology_missing_triads": {
205
+ "type": "array",
206
+ "items": {
207
+ "type": "string"
208
+ }
209
+ }
107
210
  },
108
211
  "additionalProperties": false
212
+ },
213
+ "ontology_scope": {
214
+ "$ref": "#/definitions/ontology_scope"
215
+ },
216
+ "ontology_core": {
217
+ "$ref": "#/definitions/ontology_core"
109
218
  }
110
219
  },
111
220
  "additionalProperties": false
@@ -120,11 +229,21 @@
120
229
  "scores"
121
230
  ],
122
231
  "properties": {
123
- "mode": { "const": "capability-score" },
124
- "scene_id": { "type": "string" },
125
- "generated_at": { "type": "string" },
126
- "input": { "type": "string" },
127
- "output_file": { "type": "string" },
232
+ "mode": {
233
+ "const": "capability-score"
234
+ },
235
+ "scene_id": {
236
+ "type": "string"
237
+ },
238
+ "generated_at": {
239
+ "type": "string"
240
+ },
241
+ "input": {
242
+ "type": "string"
243
+ },
244
+ "output_file": {
245
+ "type": "string"
246
+ },
128
247
  "scores": {
129
248
  "type": "object",
130
249
  "required": [
@@ -132,18 +251,53 @@
132
251
  "reuse_score",
133
252
  "stability_score",
134
253
  "risk_score",
254
+ "ontology_core_score",
255
+ "ontology_core",
135
256
  "value_score"
136
257
  ],
137
258
  "properties": {
138
- "completion_rate": { "type": "number", "minimum": 0, "maximum": 1 },
139
- "reuse_score": { "type": "integer", "minimum": 0, "maximum": 100 },
140
- "stability_score": { "type": "integer", "minimum": 0, "maximum": 100 },
141
- "risk_score": { "type": "integer", "minimum": 0, "maximum": 100 },
142
- "value_score": { "type": "integer", "minimum": 0, "maximum": 100 }
259
+ "completion_rate": {
260
+ "type": "number",
261
+ "minimum": 0,
262
+ "maximum": 1
263
+ },
264
+ "reuse_score": {
265
+ "type": "integer",
266
+ "minimum": 0,
267
+ "maximum": 100
268
+ },
269
+ "stability_score": {
270
+ "type": "integer",
271
+ "minimum": 0,
272
+ "maximum": 100
273
+ },
274
+ "risk_score": {
275
+ "type": "integer",
276
+ "minimum": 0,
277
+ "maximum": 100
278
+ },
279
+ "value_score": {
280
+ "type": "integer",
281
+ "minimum": 0,
282
+ "maximum": 100
283
+ },
284
+ "ontology_core_score": {
285
+ "type": "integer",
286
+ "minimum": 0,
287
+ "maximum": 100
288
+ },
289
+ "ontology_core": {
290
+ "$ref": "#/definitions/ontology_core"
291
+ }
143
292
  },
144
293
  "additionalProperties": false
145
294
  },
146
- "summary": { "type": ["object", "null"] }
295
+ "summary": {
296
+ "type": [
297
+ "object",
298
+ "null"
299
+ ]
300
+ }
147
301
  },
148
302
  "additionalProperties": false
149
303
  },
@@ -157,12 +311,27 @@
157
311
  "template"
158
312
  ],
159
313
  "properties": {
160
- "mode": { "const": "capability-map" },
161
- "scene_id": { "type": "string" },
162
- "generated_at": { "type": "string" },
163
- "input": { "type": "string" },
164
- "mapping": { "type": ["string", "null"] },
165
- "output_file": { "type": "string" },
314
+ "mode": {
315
+ "const": "capability-map"
316
+ },
317
+ "scene_id": {
318
+ "type": "string"
319
+ },
320
+ "generated_at": {
321
+ "type": "string"
322
+ },
323
+ "input": {
324
+ "type": "string"
325
+ },
326
+ "mapping": {
327
+ "type": [
328
+ "string",
329
+ "null"
330
+ ]
331
+ },
332
+ "output_file": {
333
+ "type": "string"
334
+ },
166
335
  "template": {
167
336
  "type": "object",
168
337
  "required": [
@@ -174,31 +343,52 @@
174
343
  "template_type",
175
344
  "scene_id",
176
345
  "ontology_scope",
177
- "created_at"
346
+ "created_at",
347
+ "ontology_core"
178
348
  ],
179
349
  "properties": {
180
- "mode": { "const": "capability-template" },
181
- "template_id": { "type": "string" },
182
- "name": { "type": "string" },
183
- "description": { "type": "string" },
184
- "category": { "type": "string" },
185
- "template_type": { "const": "capability-template" },
186
- "scene_id": { "type": "string" },
187
- "tags": { "type": "array", "items": { "type": "string" } },
350
+ "mode": {
351
+ "const": "capability-template"
352
+ },
353
+ "template_id": {
354
+ "type": "string"
355
+ },
356
+ "name": {
357
+ "type": "string"
358
+ },
359
+ "description": {
360
+ "type": "string"
361
+ },
362
+ "category": {
363
+ "type": "string"
364
+ },
365
+ "template_type": {
366
+ "const": "capability-template"
367
+ },
368
+ "scene_id": {
369
+ "type": "string"
370
+ },
371
+ "tags": {
372
+ "type": "array",
373
+ "items": {
374
+ "type": "string"
375
+ }
376
+ },
188
377
  "ontology_scope": {
189
- "type": "object",
190
- "required": ["domains", "entities", "relations", "business_rules", "decisions"],
191
- "properties": {
192
- "domains": { "type": "array", "items": { "type": "string" } },
193
- "entities": { "type": "array", "items": { "type": "string" } },
194
- "relations": { "type": "array", "items": { "type": "string" } },
195
- "business_rules": { "type": "array", "items": { "type": "string" } },
196
- "decisions": { "type": "array", "items": { "type": "string" } }
197
- },
198
- "additionalProperties": false
378
+ "$ref": "#/definitions/ontology_scope"
379
+ },
380
+ "created_at": {
381
+ "type": "string"
382
+ },
383
+ "source_candidate": {
384
+ "type": [
385
+ "object",
386
+ "null"
387
+ ]
199
388
  },
200
- "created_at": { "type": "string" },
201
- "source_candidate": { "type": ["object", "null"] }
389
+ "ontology_core": {
390
+ "$ref": "#/definitions/ontology_core"
391
+ }
202
392
  },
203
393
  "additionalProperties": false
204
394
  }
@@ -211,13 +401,257 @@
211
401
  "mode",
212
402
  "template_id",
213
403
  "output_dir",
214
- "files"
404
+ "files",
405
+ "ontology_core"
406
+ ],
407
+ "properties": {
408
+ "mode": {
409
+ "const": "capability-register"
410
+ },
411
+ "template_id": {
412
+ "type": "string"
413
+ },
414
+ "output_dir": {
415
+ "type": "string"
416
+ },
417
+ "files": {
418
+ "type": "array",
419
+ "items": {
420
+ "type": "string"
421
+ }
422
+ },
423
+ "ontology_core": {
424
+ "$ref": "#/definitions/ontology_core"
425
+ }
426
+ },
427
+ "additionalProperties": false
428
+ },
429
+ "ontology_scope": {
430
+ "type": "object",
431
+ "required": [
432
+ "domains",
433
+ "entities",
434
+ "relations",
435
+ "business_rules",
436
+ "decisions"
437
+ ],
438
+ "properties": {
439
+ "domains": {
440
+ "type": "array",
441
+ "items": {
442
+ "type": "string"
443
+ }
444
+ },
445
+ "entities": {
446
+ "type": "array",
447
+ "items": {
448
+ "type": "string"
449
+ }
450
+ },
451
+ "relations": {
452
+ "type": "array",
453
+ "items": {
454
+ "type": "string"
455
+ }
456
+ },
457
+ "business_rules": {
458
+ "type": "array",
459
+ "items": {
460
+ "type": "string"
461
+ }
462
+ },
463
+ "decisions": {
464
+ "type": "array",
465
+ "items": {
466
+ "type": "string"
467
+ }
468
+ }
469
+ },
470
+ "additionalProperties": false
471
+ },
472
+ "ontology_core": {
473
+ "type": "object",
474
+ "required": [
475
+ "triads",
476
+ "passed_count",
477
+ "total_count",
478
+ "coverage_ratio",
479
+ "ready",
480
+ "missing"
215
481
  ],
216
482
  "properties": {
217
- "mode": { "const": "capability-register" },
218
- "template_id": { "type": "string" },
219
- "output_dir": { "type": "string" },
220
- "files": { "type": "array", "items": { "type": "string" } }
483
+ "ontology_scope": {
484
+ "$ref": "#/definitions/ontology_scope"
485
+ },
486
+ "triads": {
487
+ "type": "object",
488
+ "required": [
489
+ "entity_relation",
490
+ "business_rules",
491
+ "decision_strategy"
492
+ ],
493
+ "properties": {
494
+ "entity_relation": {
495
+ "type": "object",
496
+ "required": [
497
+ "required_fields",
498
+ "entity_count",
499
+ "relation_count",
500
+ "passed"
501
+ ],
502
+ "properties": {
503
+ "required_fields": {
504
+ "type": "array",
505
+ "items": {
506
+ "type": "string"
507
+ }
508
+ },
509
+ "entity_count": {
510
+ "type": "integer",
511
+ "minimum": 0
512
+ },
513
+ "relation_count": {
514
+ "type": "integer",
515
+ "minimum": 0
516
+ },
517
+ "passed": {
518
+ "type": "boolean"
519
+ }
520
+ },
521
+ "additionalProperties": false
522
+ },
523
+ "business_rules": {
524
+ "type": "object",
525
+ "required": [
526
+ "required_fields",
527
+ "count",
528
+ "passed"
529
+ ],
530
+ "properties": {
531
+ "required_fields": {
532
+ "type": "array",
533
+ "items": {
534
+ "type": "string"
535
+ }
536
+ },
537
+ "count": {
538
+ "type": "integer",
539
+ "minimum": 0
540
+ },
541
+ "passed": {
542
+ "type": "boolean"
543
+ }
544
+ },
545
+ "additionalProperties": false
546
+ },
547
+ "decision_strategy": {
548
+ "type": "object",
549
+ "required": [
550
+ "required_fields",
551
+ "count",
552
+ "passed"
553
+ ],
554
+ "properties": {
555
+ "required_fields": {
556
+ "type": "array",
557
+ "items": {
558
+ "type": "string"
559
+ }
560
+ },
561
+ "count": {
562
+ "type": "integer",
563
+ "minimum": 0
564
+ },
565
+ "passed": {
566
+ "type": "boolean"
567
+ }
568
+ },
569
+ "additionalProperties": false
570
+ }
571
+ },
572
+ "additionalProperties": false
573
+ },
574
+ "passed_count": {
575
+ "type": "integer",
576
+ "minimum": 0
577
+ },
578
+ "total_count": {
579
+ "type": "integer",
580
+ "minimum": 0
581
+ },
582
+ "coverage_ratio": {
583
+ "type": "number",
584
+ "minimum": 0,
585
+ "maximum": 1
586
+ },
587
+ "ready": {
588
+ "type": "boolean"
589
+ },
590
+ "missing": {
591
+ "type": "array",
592
+ "items": {
593
+ "type": "string"
594
+ }
595
+ }
596
+ },
597
+ "additionalProperties": false
598
+ },
599
+ "ontology_core_ui": {
600
+ "type": "object",
601
+ "required": [
602
+ "ready",
603
+ "coverage_ratio",
604
+ "coverage_percent",
605
+ "missing",
606
+ "missing_labels",
607
+ "triads"
608
+ ],
609
+ "properties": {
610
+ "ready": {
611
+ "type": "boolean"
612
+ },
613
+ "coverage_ratio": {
614
+ "type": "number",
615
+ "minimum": 0,
616
+ "maximum": 1
617
+ },
618
+ "coverage_percent": {
619
+ "type": "integer",
620
+ "minimum": 0,
621
+ "maximum": 100
622
+ },
623
+ "missing": {
624
+ "type": "array",
625
+ "items": {
626
+ "type": "string"
627
+ }
628
+ },
629
+ "missing_labels": {
630
+ "type": "array",
631
+ "items": {
632
+ "type": "string"
633
+ }
634
+ },
635
+ "triads": {
636
+ "type": "object",
637
+ "required": [
638
+ "entity_relation",
639
+ "business_rules",
640
+ "decision_strategy"
641
+ ],
642
+ "properties": {
643
+ "entity_relation": {
644
+ "type": "boolean"
645
+ },
646
+ "business_rules": {
647
+ "type": "boolean"
648
+ },
649
+ "decision_strategy": {
650
+ "type": "boolean"
651
+ }
652
+ },
653
+ "additionalProperties": false
654
+ }
221
655
  },
222
656
  "additionalProperties": false
223
657
  }
@@ -1896,7 +1896,7 @@ Schema references:
1896
1896
 
1897
1897
  ### Capability Library Reuse (query -> match -> use)
1898
1898
 
1899
- `catalog/show/match/use` responses now include `ontology_core` so UI can render triad readiness directly.
1899
+ `catalog/list/search/show/match/use` responses now include `ontology_core` and `ontology_core_ui` so UI can render triad readiness directly.
1900
1900
 
1901
1901
  ```bash
1902
1902
  # List capability templates
@@ -36,7 +36,7 @@ sce capability extract --scene <scene_id> --specs <specs> --sample-limit <n> --j
36
36
  ```
37
37
 
38
38
  响应:
39
- - 返回 `capability-extract` payload
39
+ - 返回 `capability-extract` payload,重点消费 `ontology_core` 与 `summary.ontology_missing_triads`
40
40
 
41
41
  ---
42
42
 
@@ -59,7 +59,7 @@ sce capability score --input <candidate_file> --json
59
59
  ```
60
60
 
61
61
  响应:
62
- - 返回 `capability-score` payload
62
+ - 返回 `capability-score` payload,重点消费 `scores.ontology_core_score` 与 `scores.ontology_core`
63
63
 
64
64
  ---
65
65
 
@@ -87,7 +87,7 @@ sce capability map --input <candidate_file> --mapping <ontology_file> \
87
87
  ```
88
88
 
89
89
  响应:
90
- - 返回 `capability-map` payload
90
+ - 返回 `capability-map` payload,重点消费 `template.ontology_core`
91
91
 
92
92
  ---
93
93
 
@@ -112,7 +112,7 @@ sce capability register --input <template_file> --risk-level <level> --difficult
112
112
  ```
113
113
 
114
114
  响应:
115
- - 返回 `capability-register` payload
115
+ - 返回 `capability-register` payload,重点消费 `ontology_core`(入库 triad 审核结果)
116
116
 
117
117
  ---
118
118
 
@@ -22,6 +22,7 @@
22
22
  ├─────────────────────────────────────────────────────────────┤
23
23
  │ Scene卡片:scene.customer-order │
24
24
  │ - spec: 3 tasks: 42 completed: 36 pending: 6 │
25
+ │ - triad: 2/3 missing: decision_strategy │
25
26
  │ - score: 未评估 │
26
27
  │ [进入评估] │
27
28
  ├─────────────────────────────────────────────────────────────┤
@@ -36,8 +37,8 @@
36
37
  ┌───────────────┬─────────────────────────────────────────────┐
37
38
  │ Spec列表 │ 评分卡 │
38
39
  │ - 01-00-demo │ value: 78 reuse: 66 stability: 85 risk: 20 │
39
- │ - 01-01-check │ completion: 0.86
40
- │ - 01-02-order │
40
+ │ - 01-01-check │ completion: 0.86 ontology_core: 67
41
+ │ - 01-02-order │ missing: business_rules
41
42
  ├───────────────┼─────────────────────────────────────────────┤
42
43
  │ Task摘要 │ [生成模板候选] │
43
44
  │ total: 42 │ │
@@ -149,8 +150,9 @@ sce capability register --input <template.json> --json
149
150
  - 每一步输出的 JSON 都持久化,便于回放/复用
150
151
 
151
152
  ### 6.2 体验优化
152
- - Scene 首页显示完成率、待处理数、评分卡入口
153
- - 评分卡统一可视化(value/reuse/stability/risk)
153
+ - Scene 首页显示完成率、待处理数、triad 覆盖率、缺失项入口
154
+ - 评分卡统一可视化(value/reuse/stability/risk/ontology_core
155
+ - 盘点页支持按 triad 缺口排序:优先显示缺失 `decision_strategy` / `business_rules` / `entity_relation` 的 scene
154
156
  - 本体映射表单应支持快速导入与默认推荐值
155
157
 
156
158
  ### 6.3 错误处理
@@ -170,3 +172,11 @@ sce capability register --input <template.json> --json
170
172
  - `/capability/scene/:sceneId/template` 模板构建页
171
173
  - `/capability/scene/:sceneId/release` 发布页
172
174
 
175
+
176
+ ## 8. 推荐排序字段
177
+
178
+ - `ontology_core_ui.ready`
179
+ - `ontology_core_ui.coverage_percent`
180
+ - `ontology_core_ui.missing`
181
+ - `summary.ontology_triads_ready`
182
+ - `summary.ontology_missing_triads`
@@ -90,6 +90,14 @@ sce capability use --template <template-id> --spec <spec-id> --apply --json
90
90
 
91
91
  ## 5. 输出结构(关键字段)
92
92
 
93
+ 列表、详情、匹配、使用计划里的模板对象都应直接消费:
94
+ - `ontology_core`
95
+ - `ontology_core_ui.ready`
96
+ - `ontology_core_ui.coverage_percent`
97
+ - `ontology_core_ui.missing`
98
+ - `ontology_core_ui.triads.entity_relation|business_rules|decision_strategy`
99
+
100
+
93
101
  ### capability-match
94
102
  ```json
95
103
  {
@@ -100,6 +108,16 @@ sce capability use --template <template-id> --spec <spec-id> --apply --json
100
108
  "matches": [
101
109
  {
102
110
  "template_id": "customer-order-core",
111
+ "ontology_core_ui": {
112
+ "ready": true,
113
+ "coverage_percent": 100,
114
+ "missing": [],
115
+ "triads": {
116
+ "entity_relation": true,
117
+ "business_rules": true,
118
+ "decision_strategy": true
119
+ }
120
+ },
103
121
  "score": 82,
104
122
  "score_components": {
105
123
  "ontology": 0.72,
@@ -407,6 +407,38 @@ function assertCoreOntologySummary(summary, contextLabel = 'capability template'
407
407
  );
408
408
  }
409
409
 
410
+ function buildOntologyCoreUiState(summary) {
411
+ const details = summary || buildCoreOntologySummary(createEmptyOntologyScope());
412
+ const labels = {
413
+ entity_relation: 'entity_relation',
414
+ business_rules: 'business_rules',
415
+ decision_strategy: 'decision_strategy'
416
+ };
417
+ return {
418
+ ready: details.ready === true,
419
+ coverage_ratio: Number(details.coverage_ratio || 0),
420
+ coverage_percent: Math.round(Number(details.coverage_ratio || 0) * 100),
421
+ missing: Array.isArray(details.missing) ? details.missing : [],
422
+ missing_labels: (Array.isArray(details.missing) ? details.missing : []).map((key) => labels[key] || key),
423
+ triads: {
424
+ entity_relation: Boolean(details.triads && details.triads.entity_relation && details.triads.entity_relation.passed),
425
+ business_rules: Boolean(details.triads && details.triads.business_rules && details.triads.business_rules.passed),
426
+ decision_strategy: Boolean(details.triads && details.triads.decision_strategy && details.triads.decision_strategy.passed)
427
+ }
428
+ };
429
+ }
430
+
431
+ function enrichCapabilityTemplateForUi(template) {
432
+ const ontologyCore = template && template.ontology_core
433
+ ? template.ontology_core
434
+ : buildCoreOntologySummary(template && template.ontology_scope ? template.ontology_scope : createEmptyOntologyScope());
435
+ return {
436
+ ...template,
437
+ ontology_core: ontologyCore,
438
+ ontology_core_ui: buildOntologyCoreUiState(ontologyCore)
439
+ };
440
+ }
441
+
410
442
  async function loadSceneIndexFromFile(projectPath, fileSystem) {
411
443
  const indexPath = path.join(projectPath, '.sce', 'spec-governance', 'scene-index.json');
412
444
  if (!await fileSystem.pathExists(indexPath)) {
@@ -912,7 +944,8 @@ function displayCapabilityCatalog(templates, options = {}) {
912
944
  }
913
945
  return;
914
946
  }
915
- templates.forEach((template) => {
947
+ templates.forEach((rawTemplate) => {
948
+ const template = enrichCapabilityTemplateForUi(rawTemplate);
916
949
  const sourcePrefix = template.source && template.source !== 'official'
917
950
  ? chalk.gray(`[${template.source}] `)
918
951
  : '';
@@ -926,13 +959,13 @@ function displayCapabilityCatalog(templates, options = {}) {
926
959
 
927
960
  async function listCapabilityCatalog(options = {}) {
928
961
  const manager = new TemplateManager();
929
- const templates = await manager.listTemplates({
962
+ const templates = (await manager.listTemplates({
930
963
  category: options.category,
931
964
  source: options.source,
932
965
  templateType: 'capability-template',
933
966
  compatibleWith: options.compatibleWith,
934
967
  riskLevel: options.risk
935
- });
968
+ })).map((template) => enrichCapabilityTemplateForUi(template));
936
969
  if (normalizeBoolean(options.json, false)) {
937
970
  return {
938
971
  mode: 'capability-catalog-list',
@@ -945,13 +978,13 @@ async function listCapabilityCatalog(options = {}) {
945
978
 
946
979
  async function searchCapabilityCatalog(keyword, options = {}) {
947
980
  const manager = new TemplateManager();
948
- const templates = await manager.searchTemplates(keyword, {
981
+ const templates = (await manager.searchTemplates(keyword, {
949
982
  category: options.category,
950
983
  source: options.source,
951
984
  templateType: 'capability-template',
952
985
  compatibleWith: options.compatibleWith,
953
986
  riskLevel: options.risk
954
- });
987
+ })).map((template) => enrichCapabilityTemplateForUi(template));
955
988
  if (normalizeBoolean(options.json, false)) {
956
989
  return {
957
990
  mode: 'capability-catalog-search',
@@ -965,7 +998,7 @@ async function searchCapabilityCatalog(keyword, options = {}) {
965
998
 
966
999
  async function showCapabilityTemplate(templatePath, options = {}) {
967
1000
  const manager = new TemplateManager();
968
- const template = await manager.showTemplate(templatePath);
1001
+ const template = enrichCapabilityTemplateForUi(await manager.showTemplate(templatePath));
969
1002
  const { sourceName, templateId } = parseTemplatePath(templatePath);
970
1003
  await manager.ensureCached(sourceName);
971
1004
  const sourcePath = manager.cacheManager.getSourceCachePath(sourceName);
@@ -1038,6 +1071,7 @@ async function matchCapabilityTemplates(options = {}) {
1038
1071
  category: template.category,
1039
1072
  risk_level: template.risk_level,
1040
1073
  ontology_core: template.ontology_core || buildCoreOntologySummary(template.ontology_scope || {}),
1074
+ ontology_core_ui: buildOntologyCoreUiState(template.ontology_core || buildCoreOntologySummary(template.ontology_scope || {})),
1041
1075
  score: Math.round(totalScore * 100),
1042
1076
  score_components: {
1043
1077
  ontology: Number(overlap.score.toFixed(3)),
@@ -1123,7 +1157,8 @@ async function useCapabilityTemplate(options = {}) {
1123
1157
  source: template.source,
1124
1158
  description: template.description,
1125
1159
  ontology_scope: template.ontology_scope || {},
1126
- ontology_core: template.ontology_core || buildCoreOntologySummary(template.ontology_scope || {})
1160
+ ontology_core: template.ontology_core || buildCoreOntologySummary(template.ontology_scope || {}),
1161
+ ontology_core_ui: buildOntologyCoreUiState(template.ontology_core || buildCoreOntologySummary(template.ontology_scope || {}))
1127
1162
  },
1128
1163
  spec_id: specId,
1129
1164
  recommended_tasks: recommendedTasks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scene-capability-engine",
3
- "version": "3.6.16",
3
+ "version": "3.6.18",
4
4
  "description": "SCE (Scene Capability Engine) - A CLI tool and npm package for spec-driven development with AI coding assistants.",
5
5
  "main": "index.js",
6
6
  "bin": {