scene-capability-engine 3.6.22 → 3.6.24

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.24] - 2026-03-06
11
+
12
+ ### Added
13
+ - Capability inventory payload now exposes fixed homepage query metadata (`query`) and sorting metadata (`sort`).
14
+ - Capability iteration schema and Magicball docs now define the fixed homepage inventory protocol.
15
+
16
+ ## [3.6.23] - 2026-03-06
17
+
18
+ ### Added
19
+ - Capability inventory now applies a default homepage sort: blocked scenes first, then triad-gap priority, then value score.
20
+ - Magicball capability iteration docs now define the default scene inventory ordering contract.
21
+
10
22
  ## [3.6.22] - 2026-03-06
11
23
 
12
24
  ### Added
@@ -17,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
29
 
18
30
  ### Added
19
31
  - New `sce capability inventory` command provides scene-level triad/readiness aggregation for homepage views.
32
+ - Capability inventory now applies default sorting: publish-ready last, then triad-gap priority, then value score.
20
33
  - Capability catalog list/search now supports `--release-ready` and `--missing-triad` filters for pre-publish triage.
21
34
  - Magicball capability library docs now show list-level triage filter examples.
22
35
 
package/README.md CHANGED
@@ -218,5 +218,5 @@ MIT. See [LICENSE](LICENSE).
218
218
 
219
219
  ---
220
220
 
221
- **Version**: 3.6.22
221
+ **Version**: 3.6.24
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.22
221
+ **版本**:3.6.24
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,153 @@
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
+ ],
672
+ "properties": {
673
+ "mode": {
674
+ "const": "capability-inventory"
675
+ },
676
+ "generated_at": {
677
+ "type": "string"
678
+ },
679
+ "query": {
680
+ "type": "object",
681
+ "required": [
682
+ "protocol_version",
683
+ "scene_id",
684
+ "limit",
685
+ "sample_limit",
686
+ "filters"
687
+ ],
688
+ "properties": {
689
+ "protocol_version": {
690
+ "type": "string"
691
+ },
692
+ "scene_id": {
693
+ "type": [
694
+ "string",
695
+ "null"
696
+ ]
697
+ },
698
+ "limit": {
699
+ "type": "integer",
700
+ "minimum": 0
701
+ },
702
+ "sample_limit": {
703
+ "type": "integer",
704
+ "minimum": 0
705
+ },
706
+ "filters": {
707
+ "type": "object",
708
+ "required": [
709
+ "release_ready",
710
+ "missing_triad"
711
+ ],
712
+ "properties": {
713
+ "release_ready": {
714
+ "type": [
715
+ "boolean",
716
+ "null"
717
+ ]
718
+ },
719
+ "missing_triad": {
720
+ "type": [
721
+ "string",
722
+ "null"
723
+ ]
724
+ }
725
+ },
726
+ "additionalProperties": false
727
+ }
728
+ },
729
+ "additionalProperties": false
730
+ },
731
+ "scene_total": {
732
+ "type": "integer",
733
+ "minimum": 0
734
+ },
735
+ "scene_count": {
736
+ "type": "integer",
737
+ "minimum": 0
738
+ },
739
+ "sort": {
740
+ "type": "object",
741
+ "required": [
742
+ "strategy",
743
+ "triad_priority"
744
+ ],
745
+ "properties": {
746
+ "strategy": {
747
+ "type": "string"
748
+ },
749
+ "triad_priority": {
750
+ "type": "array",
751
+ "items": {
752
+ "type": "string"
753
+ }
754
+ }
755
+ },
756
+ "additionalProperties": false
757
+ },
758
+ "scenes": {
759
+ "type": "array",
760
+ "items": {
761
+ "type": "object",
762
+ "required": [
763
+ "scene_id",
764
+ "summary",
765
+ "source",
766
+ "ontology_scope",
767
+ "ontology_core",
768
+ "ontology_core_ui",
769
+ "release_readiness",
770
+ "release_readiness_ui",
771
+ "score_preview"
772
+ ],
773
+ "properties": {
774
+ "scene_id": {
775
+ "type": "string"
776
+ },
777
+ "summary": {
778
+ "type": "object"
779
+ },
780
+ "source": {
781
+ "type": "object"
782
+ },
783
+ "ontology_scope": {
784
+ "$ref": "#/definitions/ontology_scope"
785
+ },
786
+ "ontology_core": {
787
+ "$ref": "#/definitions/ontology_core"
788
+ },
789
+ "ontology_core_ui": {
790
+ "$ref": "#/definitions/ontology_core_ui"
791
+ },
792
+ "release_readiness": {
793
+ "type": "object"
794
+ },
795
+ "release_readiness_ui": {
796
+ "type": "object"
797
+ },
798
+ "score_preview": {
799
+ "type": "object"
800
+ }
801
+ },
802
+ "additionalProperties": false
803
+ }
804
+ }
805
+ },
806
+ "additionalProperties": false
657
807
  }
658
808
  },
659
809
  "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` 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,14 @@ 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
+ - `sort.strategy`:默认排序策略说明
190
+ - `sort.triad_priority`:triad 优先级数组
@@ -192,3 +192,17 @@ sce capability register --input <template.json> --json
192
192
  - 发布页直接消费 `release_readiness.ready`
193
193
  - 若为 `false`,展示 `blockers[].reason`、`blockers[].missing`、`blockers[].remediation`
194
194
  - 默认阻断文案:`能力模板未达到发布条件`
195
+
196
+ ## 10. 默认排序
197
+
198
+ - 先显示 `release_readiness_ui.publish_ready = false` 的 scene
199
+ - 再按 triad 缺口优先级排序:`decision_strategy` -> `business_rules` -> `entity_relation`
200
+ - 再按 `score_preview.value_score` 降序
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`
@@ -820,6 +820,45 @@ async function listCapabilityInventorySceneIds(options = {}, dependencies = {})
820
820
  return [];
821
821
  }
822
822
 
823
+ function resolveCapabilityTriadPriority(entry) {
824
+ const missing = Array.isArray(entry && entry.release_readiness_ui && entry.release_readiness_ui.blocking_missing)
825
+ ? entry.release_readiness_ui.blocking_missing
826
+ : [];
827
+ if (missing.includes('decision_strategy')) {
828
+ return 0;
829
+ }
830
+ if (missing.includes('business_rules')) {
831
+ return 1;
832
+ }
833
+ if (missing.includes('entity_relation')) {
834
+ return 2;
835
+ }
836
+ return 3;
837
+ }
838
+
839
+ function sortCapabilityInventoryEntries(entries) {
840
+ return [...(Array.isArray(entries) ? entries : [])].sort((left, right) => {
841
+ const leftReady = Boolean(left && left.release_readiness_ui && left.release_readiness_ui.publish_ready);
842
+ const rightReady = Boolean(right && right.release_readiness_ui && right.release_readiness_ui.publish_ready);
843
+ if (leftReady !== rightReady) {
844
+ return leftReady ? 1 : -1;
845
+ }
846
+
847
+ const triadDelta = resolveCapabilityTriadPriority(left) - resolveCapabilityTriadPriority(right);
848
+ if (triadDelta !== 0) {
849
+ return triadDelta;
850
+ }
851
+
852
+ const leftValue = Number(left && left.score_preview && left.score_preview.value_score || 0);
853
+ const rightValue = Number(right && right.score_preview && right.score_preview.value_score || 0);
854
+ if (leftValue !== rightValue) {
855
+ return rightValue - leftValue;
856
+ }
857
+
858
+ return String(left && left.scene_id || '').localeCompare(String(right && right.scene_id || ''));
859
+ });
860
+ }
861
+
823
862
  function filterCapabilityInventoryEntries(entries, options = {}) {
824
863
  const normalizedMissingTriad = normalizeText(options.missingTriad || options.missing_triad).toLowerCase();
825
864
  const releaseReadyFilter = normalizeText(options.releaseReady || options.release_ready).toLowerCase();
@@ -874,11 +913,27 @@ async function runCapabilityInventoryCommand(options = {}, dependencies = {}) {
874
913
  });
875
914
  }
876
915
 
877
- const filteredScenes = filterCapabilityInventoryEntries(scenes, options);
916
+ const filteredScenes = sortCapabilityInventoryEntries(filterCapabilityInventoryEntries(scenes, options));
917
+ const releaseReadyFilterRaw = normalizeText(options.releaseReady || options.release_ready).toLowerCase();
878
918
  const payload = {
879
919
  mode: 'capability-inventory',
880
920
  generated_at: new Date().toISOString(),
921
+ query: {
922
+ protocol_version: '1.0',
923
+ scene_id: normalizeText(options.scene || options.sceneId || options.scene_id) || null,
924
+ limit: limit,
925
+ sample_limit: toPositiveInteger(options.sample_limit, 5),
926
+ filters: {
927
+ release_ready: releaseReadyFilterRaw ? ['1', 'true', 'yes', 'ready'].includes(releaseReadyFilterRaw) : null,
928
+ missing_triad: normalizeText(options.missingTriad || options.missing_triad) || null
929
+ }
930
+ },
931
+ scene_total: scenes.length,
881
932
  scene_count: filteredScenes.length,
933
+ sort: {
934
+ strategy: 'publish_ready -> missing_triad_priority -> value_score_desc -> scene_id',
935
+ triad_priority: ['decision_strategy', 'business_rules', 'entity_relation']
936
+ },
882
937
  scenes: filteredScenes
883
938
  };
884
939
 
@@ -1661,5 +1716,6 @@ module.exports = {
1661
1716
  enrichCapabilityTemplateForUi,
1662
1717
  buildCapabilityReleaseReadinessUi,
1663
1718
  filterCapabilityCatalogEntries,
1664
- filterCapabilityInventoryEntries
1719
+ filterCapabilityInventoryEntries,
1720
+ sortCapabilityInventoryEntries
1665
1721
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scene-capability-engine",
3
- "version": "3.6.22",
3
+ "version": "3.6.24",
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": {