scene-capability-engine 3.6.23 → 3.6.25

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.25] - 2026-03-06
11
+
12
+ ### Added
13
+ - Capability inventory now exposes homepage summary stats for publish readiness and triad gap cards.
14
+ - Capability iteration schema and Magicball docs now define the homepage summary card contract.
15
+
16
+ ## [3.6.24] - 2026-03-06
17
+
18
+ ### Added
19
+ - Capability inventory payload now exposes fixed homepage query metadata (`query`), summary stats (`summary_stats`), and sorting metadata (`sort`).
20
+ - Capability iteration schema and Magicball docs now define the fixed homepage inventory protocol.
21
+
10
22
  ## [3.6.23] - 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.23
221
+ **Version**: 3.6.25
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.23
221
+ **版本**:3.6.25
222
222
  **最后更新**:2026-03-05
@@ -21,6 +21,9 @@
21
21
  },
22
22
  "registry": {
23
23
  "$ref": "#/definitions/registry"
24
+ },
25
+ "inventory": {
26
+ "$ref": "#/definitions/inventory"
24
27
  }
25
28
  },
26
29
  "definitions": {
@@ -654,6 +657,196 @@
654
657
  }
655
658
  },
656
659
  "additionalProperties": false
660
+ },
661
+ "inventory": {
662
+ "type": "object",
663
+ "required": [
664
+ "mode",
665
+ "generated_at",
666
+ "query",
667
+ "scene_total",
668
+ "scene_count",
669
+ "sort",
670
+ "scenes",
671
+ "summary_stats"
672
+ ],
673
+ "properties": {
674
+ "mode": {
675
+ "const": "capability-inventory"
676
+ },
677
+ "generated_at": {
678
+ "type": "string"
679
+ },
680
+ "query": {
681
+ "type": "object",
682
+ "required": [
683
+ "protocol_version",
684
+ "scene_id",
685
+ "limit",
686
+ "sample_limit",
687
+ "filters"
688
+ ],
689
+ "properties": {
690
+ "protocol_version": {
691
+ "type": "string"
692
+ },
693
+ "scene_id": {
694
+ "type": [
695
+ "string",
696
+ "null"
697
+ ]
698
+ },
699
+ "limit": {
700
+ "type": "integer",
701
+ "minimum": 0
702
+ },
703
+ "sample_limit": {
704
+ "type": "integer",
705
+ "minimum": 0
706
+ },
707
+ "filters": {
708
+ "type": "object",
709
+ "required": [
710
+ "release_ready",
711
+ "missing_triad"
712
+ ],
713
+ "properties": {
714
+ "release_ready": {
715
+ "type": [
716
+ "boolean",
717
+ "null"
718
+ ]
719
+ },
720
+ "missing_triad": {
721
+ "type": [
722
+ "string",
723
+ "null"
724
+ ]
725
+ }
726
+ },
727
+ "additionalProperties": false
728
+ }
729
+ },
730
+ "additionalProperties": false
731
+ },
732
+ "scene_total": {
733
+ "type": "integer",
734
+ "minimum": 0
735
+ },
736
+ "scene_count": {
737
+ "type": "integer",
738
+ "minimum": 0
739
+ },
740
+ "sort": {
741
+ "type": "object",
742
+ "required": [
743
+ "strategy",
744
+ "triad_priority"
745
+ ],
746
+ "properties": {
747
+ "strategy": {
748
+ "type": "string"
749
+ },
750
+ "triad_priority": {
751
+ "type": "array",
752
+ "items": {
753
+ "type": "string"
754
+ }
755
+ }
756
+ },
757
+ "additionalProperties": false
758
+ },
759
+ "scenes": {
760
+ "type": "array",
761
+ "items": {
762
+ "type": "object",
763
+ "required": [
764
+ "scene_id",
765
+ "summary",
766
+ "source",
767
+ "ontology_scope",
768
+ "ontology_core",
769
+ "ontology_core_ui",
770
+ "release_readiness",
771
+ "release_readiness_ui",
772
+ "score_preview"
773
+ ],
774
+ "properties": {
775
+ "scene_id": {
776
+ "type": "string"
777
+ },
778
+ "summary": {
779
+ "type": "object"
780
+ },
781
+ "source": {
782
+ "type": "object"
783
+ },
784
+ "ontology_scope": {
785
+ "$ref": "#/definitions/ontology_scope"
786
+ },
787
+ "ontology_core": {
788
+ "$ref": "#/definitions/ontology_core"
789
+ },
790
+ "ontology_core_ui": {
791
+ "$ref": "#/definitions/ontology_core_ui"
792
+ },
793
+ "release_readiness": {
794
+ "type": "object"
795
+ },
796
+ "release_readiness_ui": {
797
+ "type": "object"
798
+ },
799
+ "score_preview": {
800
+ "type": "object"
801
+ }
802
+ },
803
+ "additionalProperties": false
804
+ }
805
+ },
806
+ "summary_stats": {
807
+ "type": "object",
808
+ "required": [
809
+ "publish_ready_count",
810
+ "blocked_count",
811
+ "missing_triads"
812
+ ],
813
+ "properties": {
814
+ "publish_ready_count": {
815
+ "type": "integer",
816
+ "minimum": 0
817
+ },
818
+ "blocked_count": {
819
+ "type": "integer",
820
+ "minimum": 0
821
+ },
822
+ "missing_triads": {
823
+ "type": "object",
824
+ "required": [
825
+ "decision_strategy",
826
+ "business_rules",
827
+ "entity_relation"
828
+ ],
829
+ "properties": {
830
+ "decision_strategy": {
831
+ "type": "integer",
832
+ "minimum": 0
833
+ },
834
+ "business_rules": {
835
+ "type": "integer",
836
+ "minimum": 0
837
+ },
838
+ "entity_relation": {
839
+ "type": "integer",
840
+ "minimum": 0
841
+ }
842
+ },
843
+ "additionalProperties": false
844
+ }
845
+ },
846
+ "additionalProperties": false
847
+ }
848
+ },
849
+ "additionalProperties": false
657
850
  }
658
851
  },
659
852
  "additionalProperties": false
@@ -1875,6 +1875,8 @@ 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`.
1879
+
1878
1880
 
1879
1881
  Capability candidates are now evaluated against the ontology core triad by default:
1880
1882
  - entity + relation
@@ -177,3 +177,16 @@ sce capability register --input <template_file> --risk-level <level> --difficult
177
177
  4. `/api/capability/map`
178
178
  5. `/api/capability/register`
179
179
 
180
+
181
+ ## 6. Inventory 固定查询协议
182
+
183
+ - `query.protocol_version`:前后端协议版本
184
+ - `query.scene_id`:单场景盘点时使用,否则为 `null`
185
+ - `query.limit`:场景返回上限
186
+ - `query.sample_limit`:每个 spec 抽样任务上限
187
+ - `query.filters.release_ready`:发布可用性过滤
188
+ - `query.filters.missing_triad`:triad 缺口过滤
189
+ - `summary_stats.publish_ready_count` / `summary_stats.blocked_count`:顶部统计卡
190
+ - `summary_stats.missing_triads.*`:triad 缺口计数卡
191
+ - `sort.strategy`:默认排序策略说明
192
+ - `sort.triad_priority`:triad 优先级数组
@@ -199,3 +199,18 @@ sce capability register --input <template.json> --json
199
199
  - 再按 triad 缺口优先级排序:`decision_strategy` -> `business_rules` -> `entity_relation`
200
200
  - 再按 `score_preview.value_score` 降序
201
201
  - 最后按 `scene_id` 升序
202
+
203
+ ## 11. 首页固定查询协议
204
+
205
+ - 使用 `capability-inventory` 返回的 `query` 作为首页请求回显
206
+ - 使用 `sort` 作为排序策略展示来源
207
+ - 首页筛选器应直接映射:`query.filters.release_ready`、`query.filters.missing_triad`
208
+ - 首页顶部可显示:`scene_total` / `scene_count` / `summary_stats`
209
+
210
+ ## 12. 顶部统计卡
211
+
212
+ - `summary_stats.publish_ready_count`:可发布 scene 数
213
+ - `summary_stats.blocked_count`:被阻断 scene 数
214
+ - `summary_stats.missing_triads.decision_strategy`:缺决策策略数量
215
+ - `summary_stats.missing_triads.business_rules`:缺业务规则数量
216
+ - `summary_stats.missing_triads.entity_relation`:缺实体关系数量
@@ -836,6 +836,39 @@ function resolveCapabilityTriadPriority(entry) {
836
836
  return 3;
837
837
  }
838
838
 
839
+ function buildCapabilityInventorySummaryStats(entries) {
840
+ const items = Array.isArray(entries) ? entries : [];
841
+ const summary = {
842
+ publish_ready_count: 0,
843
+ blocked_count: 0,
844
+ missing_triads: {
845
+ decision_strategy: 0,
846
+ business_rules: 0,
847
+ entity_relation: 0
848
+ }
849
+ };
850
+
851
+ for (const entry of items) {
852
+ const ready = Boolean(entry && entry.release_readiness_ui && entry.release_readiness_ui.publish_ready);
853
+ if (ready) {
854
+ summary.publish_ready_count += 1;
855
+ } else {
856
+ summary.blocked_count += 1;
857
+ }
858
+
859
+ const missing = Array.isArray(entry && entry.release_readiness_ui && entry.release_readiness_ui.blocking_missing)
860
+ ? entry.release_readiness_ui.blocking_missing
861
+ : [];
862
+ for (const triad of Object.keys(summary.missing_triads)) {
863
+ if (missing.includes(triad)) {
864
+ summary.missing_triads[triad] += 1;
865
+ }
866
+ }
867
+ }
868
+
869
+ return summary;
870
+ }
871
+
839
872
  function sortCapabilityInventoryEntries(entries) {
840
873
  return [...(Array.isArray(entries) ? entries : [])].sort((left, right) => {
841
874
  const leftReady = Boolean(left && left.release_readiness_ui && left.release_readiness_ui.publish_ready);
@@ -914,10 +947,23 @@ async function runCapabilityInventoryCommand(options = {}, dependencies = {}) {
914
947
  }
915
948
 
916
949
  const filteredScenes = sortCapabilityInventoryEntries(filterCapabilityInventoryEntries(scenes, options));
950
+ const releaseReadyFilterRaw = normalizeText(options.releaseReady || options.release_ready).toLowerCase();
917
951
  const payload = {
918
952
  mode: 'capability-inventory',
919
953
  generated_at: new Date().toISOString(),
954
+ query: {
955
+ protocol_version: '1.0',
956
+ scene_id: normalizeText(options.scene || options.sceneId || options.scene_id) || null,
957
+ limit: limit,
958
+ sample_limit: toPositiveInteger(options.sample_limit, 5),
959
+ filters: {
960
+ release_ready: releaseReadyFilterRaw ? ['1', 'true', 'yes', 'ready'].includes(releaseReadyFilterRaw) : null,
961
+ missing_triad: normalizeText(options.missingTriad || options.missing_triad) || null
962
+ }
963
+ },
964
+ scene_total: scenes.length,
920
965
  scene_count: filteredScenes.length,
966
+ summary_stats: buildCapabilityInventorySummaryStats(filteredScenes),
921
967
  sort: {
922
968
  strategy: 'publish_ready -> missing_triad_priority -> value_score_desc -> scene_id',
923
969
  triad_priority: ['decision_strategy', 'business_rules', 'entity_relation']
@@ -1705,5 +1751,6 @@ module.exports = {
1705
1751
  buildCapabilityReleaseReadinessUi,
1706
1752
  filterCapabilityCatalogEntries,
1707
1753
  filterCapabilityInventoryEntries,
1708
- sortCapabilityInventoryEntries
1754
+ sortCapabilityInventoryEntries,
1755
+ buildCapabilityInventorySummaryStats
1709
1756
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scene-capability-engine",
3
- "version": "3.6.23",
3
+ "version": "3.6.25",
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": {