scene-capability-engine 3.6.25 → 3.6.26
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 +7 -1
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/docs/agent-runtime/capability-iteration-ui.schema.json +72 -2
- package/docs/command-reference.md +1 -1
- package/docs/magicball-capability-iteration-api.md +2 -0
- package/docs/magicball-capability-iteration-ui.md +13 -0
- package/lib/commands/capability.js +108 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.6.26] - 2026-03-06
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Capability inventory now exposes scene-level advice fields, homepage summary recommendations, and quick filters for Magicball dashboards.
|
|
14
|
+
- Capability iteration schema and Magicball docs now define the homepage recommendation contract.
|
|
15
|
+
|
|
10
16
|
## [3.6.25] - 2026-03-06
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -16,7 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
16
22
|
## [3.6.24] - 2026-03-06
|
|
17
23
|
|
|
18
24
|
### Added
|
|
19
|
-
- Capability inventory payload now exposes fixed homepage query metadata (`query`), summary stats (`summary_stats`), and sorting metadata (`sort`).
|
|
25
|
+
- Capability inventory payload now exposes fixed homepage query metadata (`query`), summary stats (`summary_stats`), summary recommendations, quick filters, and sorting metadata (`sort`).
|
|
20
26
|
- Capability iteration schema and Magicball docs now define the fixed homepage inventory protocol.
|
|
21
27
|
|
|
22
28
|
## [3.6.23] - 2026-03-06
|
package/README.md
CHANGED
package/README.zh.md
CHANGED
|
@@ -668,7 +668,9 @@
|
|
|
668
668
|
"scene_count",
|
|
669
669
|
"sort",
|
|
670
670
|
"scenes",
|
|
671
|
-
"summary_stats"
|
|
671
|
+
"summary_stats",
|
|
672
|
+
"summary_recommendations",
|
|
673
|
+
"quick_filters"
|
|
672
674
|
],
|
|
673
675
|
"properties": {
|
|
674
676
|
"mode": {
|
|
@@ -769,7 +771,12 @@
|
|
|
769
771
|
"ontology_core_ui",
|
|
770
772
|
"release_readiness",
|
|
771
773
|
"release_readiness_ui",
|
|
772
|
-
"score_preview"
|
|
774
|
+
"score_preview",
|
|
775
|
+
"attention_level",
|
|
776
|
+
"recommended_action",
|
|
777
|
+
"blocking_summary",
|
|
778
|
+
"next_action",
|
|
779
|
+
"next_command"
|
|
773
780
|
],
|
|
774
781
|
"properties": {
|
|
775
782
|
"scene_id": {
|
|
@@ -798,6 +805,21 @@
|
|
|
798
805
|
},
|
|
799
806
|
"score_preview": {
|
|
800
807
|
"type": "object"
|
|
808
|
+
},
|
|
809
|
+
"attention_level": {
|
|
810
|
+
"type": "string"
|
|
811
|
+
},
|
|
812
|
+
"recommended_action": {
|
|
813
|
+
"type": "string"
|
|
814
|
+
},
|
|
815
|
+
"blocking_summary": {
|
|
816
|
+
"type": "string"
|
|
817
|
+
},
|
|
818
|
+
"next_action": {
|
|
819
|
+
"type": "string"
|
|
820
|
+
},
|
|
821
|
+
"next_command": {
|
|
822
|
+
"type": "string"
|
|
801
823
|
}
|
|
802
824
|
},
|
|
803
825
|
"additionalProperties": false
|
|
@@ -844,6 +866,54 @@
|
|
|
844
866
|
}
|
|
845
867
|
},
|
|
846
868
|
"additionalProperties": false
|
|
869
|
+
},
|
|
870
|
+
"summary_recommendations": {
|
|
871
|
+
"type": "array",
|
|
872
|
+
"items": {
|
|
873
|
+
"type": "string"
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
"quick_filters": {
|
|
877
|
+
"type": "array",
|
|
878
|
+
"items": {
|
|
879
|
+
"type": "object",
|
|
880
|
+
"required": [
|
|
881
|
+
"id",
|
|
882
|
+
"label",
|
|
883
|
+
"query"
|
|
884
|
+
],
|
|
885
|
+
"properties": {
|
|
886
|
+
"id": {
|
|
887
|
+
"type": "string"
|
|
888
|
+
},
|
|
889
|
+
"label": {
|
|
890
|
+
"type": "string"
|
|
891
|
+
},
|
|
892
|
+
"query": {
|
|
893
|
+
"type": "object",
|
|
894
|
+
"required": [
|
|
895
|
+
"release_ready",
|
|
896
|
+
"missing_triad"
|
|
897
|
+
],
|
|
898
|
+
"properties": {
|
|
899
|
+
"release_ready": {
|
|
900
|
+
"type": [
|
|
901
|
+
"boolean",
|
|
902
|
+
"null"
|
|
903
|
+
]
|
|
904
|
+
},
|
|
905
|
+
"missing_triad": {
|
|
906
|
+
"type": [
|
|
907
|
+
"string",
|
|
908
|
+
"null"
|
|
909
|
+
]
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
"additionalProperties": false
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
"additionalProperties": false
|
|
916
|
+
}
|
|
847
917
|
}
|
|
848
918
|
},
|
|
849
919
|
"additionalProperties": false
|
|
@@ -1875,7 +1875,7 @@ sce capability inventory --json
|
|
|
1875
1875
|
sce capability inventory --release-ready false --missing-triad decision_strategy --json
|
|
1876
1876
|
```
|
|
1877
1877
|
|
|
1878
|
-
`capability inventory` returns fixed homepage query metadata in `query`, summary cards in `summary_stats`, and sorting metadata in `sort`.
|
|
1878
|
+
`capability inventory` returns fixed homepage query metadata in `query`, summary cards in `summary_stats`, top recommendations in `summary_recommendations`, quick filters in `quick_filters`, and sorting metadata in `sort`.
|
|
1879
1879
|
|
|
1880
1880
|
|
|
1881
1881
|
Capability candidates are now evaluated against the ontology core triad by default:
|
|
@@ -188,5 +188,7 @@ sce capability register --input <template_file> --risk-level <level> --difficult
|
|
|
188
188
|
- `query.filters.missing_triad`:triad 缺口过滤
|
|
189
189
|
- `summary_stats.publish_ready_count` / `summary_stats.blocked_count`:顶部统计卡
|
|
190
190
|
- `summary_stats.missing_triads.*`:triad 缺口计数卡
|
|
191
|
+
- `summary_recommendations[]`:首页总览建议
|
|
192
|
+
- `quick_filters[]`:首页快捷筛选配置
|
|
191
193
|
- `sort.strategy`:默认排序策略说明
|
|
192
194
|
- `sort.triad_priority`:triad 优先级数组
|
|
@@ -214,3 +214,16 @@ sce capability register --input <template.json> --json
|
|
|
214
214
|
- `summary_stats.missing_triads.decision_strategy`:缺决策策略数量
|
|
215
215
|
- `summary_stats.missing_triads.business_rules`:缺业务规则数量
|
|
216
216
|
- `summary_stats.missing_triads.entity_relation`:缺实体关系数量
|
|
217
|
+
|
|
218
|
+
## 13. Scene 卡片建议字段
|
|
219
|
+
|
|
220
|
+
- `attention_level`:critical/high/medium/low
|
|
221
|
+
- `recommended_action`:卡片主建议
|
|
222
|
+
- `blocking_summary`:一行摘要
|
|
223
|
+
- `next_action`:前端动作 key
|
|
224
|
+
- `next_command`:默认 CLI 建议
|
|
225
|
+
|
|
226
|
+
## 14. 首页总览建议字段
|
|
227
|
+
|
|
228
|
+
- `summary_recommendations[]`:顶部全局建议
|
|
229
|
+
- `quick_filters[]`:推荐快捷筛选
|
|
@@ -836,6 +836,60 @@ function resolveCapabilityTriadPriority(entry) {
|
|
|
836
836
|
return 3;
|
|
837
837
|
}
|
|
838
838
|
|
|
839
|
+
function buildCapabilityInventorySceneAdvice(entry) {
|
|
840
|
+
const sceneId = String(entry && entry.scene_id || 'scene.unknown');
|
|
841
|
+
const releaseUi = entry && entry.release_readiness_ui ? entry.release_readiness_ui : { publish_ready: true, blocking_missing: [] };
|
|
842
|
+
const missing = Array.isArray(releaseUi.blocking_missing) ? releaseUi.blocking_missing : [];
|
|
843
|
+
const valueScore = Number(entry && entry.score_preview && entry.score_preview.value_score || 0);
|
|
844
|
+
|
|
845
|
+
let attentionLevel = 'low';
|
|
846
|
+
let recommendedAction = '可直接发布';
|
|
847
|
+
let blockingSummary = '已满足发布前置条件';
|
|
848
|
+
let nextAction = 'publish';
|
|
849
|
+
|
|
850
|
+
if (!releaseUi.publish_ready) {
|
|
851
|
+
if (missing.includes('decision_strategy')) {
|
|
852
|
+
attentionLevel = 'critical';
|
|
853
|
+
recommendedAction = '补齐决策策略';
|
|
854
|
+
blockingSummary = '缺决策策略,暂不可发布';
|
|
855
|
+
nextAction = 'fill_decision_strategy';
|
|
856
|
+
} else if (missing.includes('business_rules')) {
|
|
857
|
+
attentionLevel = 'high';
|
|
858
|
+
recommendedAction = '补齐业务规则';
|
|
859
|
+
blockingSummary = '缺业务规则,暂不可发布';
|
|
860
|
+
nextAction = 'fill_business_rules';
|
|
861
|
+
} else if (missing.includes('entity_relation')) {
|
|
862
|
+
attentionLevel = 'medium';
|
|
863
|
+
recommendedAction = '补齐实体关系';
|
|
864
|
+
blockingSummary = '缺实体关系,暂不可发布';
|
|
865
|
+
nextAction = 'fill_entity_relation';
|
|
866
|
+
} else {
|
|
867
|
+
attentionLevel = 'medium';
|
|
868
|
+
recommendedAction = '补齐本体能力';
|
|
869
|
+
blockingSummary = '本体能力不完整,暂不可发布';
|
|
870
|
+
nextAction = 'repair_ontology_core';
|
|
871
|
+
}
|
|
872
|
+
} else if (valueScore >= 70) {
|
|
873
|
+
attentionLevel = 'low';
|
|
874
|
+
recommendedAction = '进入模板构建';
|
|
875
|
+
blockingSummary = '能力成熟度较高,可进入模板构建/发布';
|
|
876
|
+
nextAction = 'build_template';
|
|
877
|
+
} else {
|
|
878
|
+
attentionLevel = 'medium';
|
|
879
|
+
recommendedAction = '继续补充任务证据';
|
|
880
|
+
blockingSummary = '已可发布,但建议先补强任务与验证证据';
|
|
881
|
+
nextAction = 'strengthen_evidence';
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
return {
|
|
885
|
+
attention_level: attentionLevel,
|
|
886
|
+
recommended_action: recommendedAction,
|
|
887
|
+
blocking_summary: blockingSummary,
|
|
888
|
+
next_action: nextAction,
|
|
889
|
+
next_command: 'sce capability extract --scene ' + sceneId + ' --json'
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
|
|
839
893
|
function buildCapabilityInventorySummaryStats(entries) {
|
|
840
894
|
const items = Array.isArray(entries) ? entries : [];
|
|
841
895
|
const summary = {
|
|
@@ -869,6 +923,47 @@ function buildCapabilityInventorySummaryStats(entries) {
|
|
|
869
923
|
return summary;
|
|
870
924
|
}
|
|
871
925
|
|
|
926
|
+
function buildCapabilityInventorySummaryRecommendations(entries) {
|
|
927
|
+
const items = Array.isArray(entries) ? entries : [];
|
|
928
|
+
const recommendations = [];
|
|
929
|
+
const blocked = items.filter((item) => !(item && item.release_readiness_ui && item.release_readiness_ui.publish_ready));
|
|
930
|
+
const missingDecision = blocked.filter((item) => Array.isArray(item.release_readiness_ui && item.release_readiness_ui.blocking_missing) && item.release_readiness_ui.blocking_missing.includes('decision_strategy'));
|
|
931
|
+
const missingRules = blocked.filter((item) => Array.isArray(item.release_readiness_ui && item.release_readiness_ui.blocking_missing) && item.release_readiness_ui.blocking_missing.includes('business_rules'));
|
|
932
|
+
const readyScenes = items.filter((item) => item && item.release_readiness_ui && item.release_readiness_ui.publish_ready);
|
|
933
|
+
|
|
934
|
+
if (missingDecision.length > 0) {
|
|
935
|
+
recommendations.push('优先处理缺决策策略的 scene(' + missingDecision.length + ')');
|
|
936
|
+
}
|
|
937
|
+
if (missingRules.length > 0) {
|
|
938
|
+
recommendations.push('其次处理缺业务规则的 scene(' + missingRules.length + ')');
|
|
939
|
+
}
|
|
940
|
+
if (readyScenes.length > 0) {
|
|
941
|
+
recommendations.push('可优先推进可发布 scene 进入模板构建(' + readyScenes.length + ')');
|
|
942
|
+
}
|
|
943
|
+
if (blocked.length === 0 && readyScenes.length === 0 && items.length > 0) {
|
|
944
|
+
recommendations.push('当前 scene 已基本稳定,可继续补强验证证据');
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
return recommendations;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
function buildCapabilityInventoryQuickFilters(summaryStats) {
|
|
951
|
+
const stats = summaryStats || { blocked_count: 0, missing_triads: {} };
|
|
952
|
+
const filters = [];
|
|
953
|
+
if (Number(stats.blocked_count || 0) > 0) {
|
|
954
|
+
filters.push({ id: 'blocked', label: '不可发布', query: { release_ready: false, missing_triad: null } });
|
|
955
|
+
}
|
|
956
|
+
for (const triad of ['decision_strategy', 'business_rules', 'entity_relation']) {
|
|
957
|
+
if (Number(stats.missing_triads && stats.missing_triads[triad] || 0) > 0) {
|
|
958
|
+
filters.push({ id: 'missing_' + triad, label: '缺' + triad, query: { release_ready: false, missing_triad: triad } });
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
if (Number(stats.publish_ready_count || 0) > 0) {
|
|
962
|
+
filters.push({ id: 'ready', label: '可发布', query: { release_ready: true, missing_triad: null } });
|
|
963
|
+
}
|
|
964
|
+
return filters;
|
|
965
|
+
}
|
|
966
|
+
|
|
872
967
|
function sortCapabilityInventoryEntries(entries) {
|
|
873
968
|
return [...(Array.isArray(entries) ? entries : [])].sort((left, right) => {
|
|
874
969
|
const leftReady = Boolean(left && left.release_readiness_ui && left.release_readiness_ui.publish_ready);
|
|
@@ -933,7 +1028,7 @@ async function runCapabilityInventoryCommand(options = {}, dependencies = {}) {
|
|
|
933
1028
|
ontology_scope: candidate.ontology_scope,
|
|
934
1029
|
ontology_core: candidate.ontology_core
|
|
935
1030
|
});
|
|
936
|
-
|
|
1031
|
+
const sceneEntry = {
|
|
937
1032
|
scene_id: sceneId,
|
|
938
1033
|
summary: candidate.summary,
|
|
939
1034
|
source: candidate.source,
|
|
@@ -943,10 +1038,15 @@ async function runCapabilityInventoryCommand(options = {}, dependencies = {}) {
|
|
|
943
1038
|
release_readiness: releaseReadiness,
|
|
944
1039
|
release_readiness_ui: buildCapabilityReleaseReadinessUi(releaseReadiness),
|
|
945
1040
|
score_preview: score
|
|
1041
|
+
};
|
|
1042
|
+
scenes.push({
|
|
1043
|
+
...sceneEntry,
|
|
1044
|
+
...buildCapabilityInventorySceneAdvice(sceneEntry)
|
|
946
1045
|
});
|
|
947
1046
|
}
|
|
948
1047
|
|
|
949
1048
|
const filteredScenes = sortCapabilityInventoryEntries(filterCapabilityInventoryEntries(scenes, options));
|
|
1049
|
+
const summaryStats = buildCapabilityInventorySummaryStats(filteredScenes);
|
|
950
1050
|
const releaseReadyFilterRaw = normalizeText(options.releaseReady || options.release_ready).toLowerCase();
|
|
951
1051
|
const payload = {
|
|
952
1052
|
mode: 'capability-inventory',
|
|
@@ -963,7 +1063,9 @@ async function runCapabilityInventoryCommand(options = {}, dependencies = {}) {
|
|
|
963
1063
|
},
|
|
964
1064
|
scene_total: scenes.length,
|
|
965
1065
|
scene_count: filteredScenes.length,
|
|
966
|
-
summary_stats:
|
|
1066
|
+
summary_stats: summaryStats,
|
|
1067
|
+
summary_recommendations: buildCapabilityInventorySummaryRecommendations(filteredScenes),
|
|
1068
|
+
quick_filters: buildCapabilityInventoryQuickFilters(summaryStats),
|
|
967
1069
|
sort: {
|
|
968
1070
|
strategy: 'publish_ready -> missing_triad_priority -> value_score_desc -> scene_id',
|
|
969
1071
|
triad_priority: ['decision_strategy', 'business_rules', 'entity_relation']
|
|
@@ -1752,5 +1854,8 @@ module.exports = {
|
|
|
1752
1854
|
filterCapabilityCatalogEntries,
|
|
1753
1855
|
filterCapabilityInventoryEntries,
|
|
1754
1856
|
sortCapabilityInventoryEntries,
|
|
1755
|
-
|
|
1857
|
+
buildCapabilityInventorySceneAdvice,
|
|
1858
|
+
buildCapabilityInventorySummaryStats,
|
|
1859
|
+
buildCapabilityInventorySummaryRecommendations,
|
|
1860
|
+
buildCapabilityInventoryQuickFilters
|
|
1756
1861
|
};
|
package/package.json
CHANGED