scene-capability-engine 3.0.3 → 3.0.4

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.
@@ -725,7 +725,11 @@ Close-loop controller session maintenance:
725
725
  Cross-archive autonomous governance maintenance:
726
726
  - `sce auto governance stats [--days <n>] [--status <csv>] [--json]`: aggregate a unified governance snapshot from session/batch-session/controller-session archives plus recovery memory state.
727
727
  - JSON output includes `totals`, `throughput`, `health` (`risk_level`, `concerns`, `recommendations`, `release_gate`, `handoff_quality`), `top_master_specs`, `recovery_memory`, and full per-archive stats under `archives`.
728
- - `health.handoff_quality` carries Moqui matrix regression governance signals:
728
+ - `health.handoff_quality` carries Moqui matrix + capability lexicon governance signals:
729
+ - `latest_capability_expected_unknown_count`
730
+ - `latest_capability_provided_unknown_count`
731
+ - `capability_expected_unknown_positive_rate_percent`
732
+ - `capability_provided_unknown_positive_rate_percent`
729
733
  - `latest_moqui_matrix_regression_count`
730
734
  - `latest_moqui_matrix_regression_gate_max`
731
735
  - `avg_moqui_matrix_regression_count`
@@ -743,6 +747,10 @@ Cross-archive autonomous governance maintenance:
743
747
  - `--execute-advisory` enables automatic advisory action execution (`recover-latest`, `controller-resume-latest`) when governance assessment detects failed sessions or controller pending goals; sce auto-selects the latest actionable advisory source and reports `skipped` (not `failed`) when no actionable source exists.
744
748
  - JSON output includes round-by-round risk/action telemetry (`rounds`, with `risk_before/risk_after` and `release_gate_before/release_gate_after`), advisory telemetry (`execute_advisory`, `advisory_policy`, `advisory_summary`, `rounds[*].advisory_actions`), `stop_detail` + `recommendations` for explicit blocking reasons, plus `initial_assessment`, `final_assessment`, and convergence metadata.
745
749
  - Release-gate block reasons now include handoff matrix regression reasons when present:
750
+ - `handoff-capability-expected-unknown-positive:<n>`
751
+ - `handoff-capability-provided-unknown-positive:<n>`
752
+ - `handoff-capability-expected-unknown-positive-rate:<percent>`
753
+ - `handoff-capability-provided-unknown-positive-rate:<percent>`
746
754
  - `handoff-moqui-matrix-regressions-positive:<n>`
747
755
  - `handoff-moqui-matrix-regressions-over-gate:<n>/<max>`
748
756
  - `sce auto governance session list [--limit <n>] [--status <csv>] [--resume-only] [--json]`: list persisted governance close-loop sessions (`--resume-only` filters to resumed-chain sessions only).
@@ -814,11 +822,13 @@ Dual-track handoff integration:
814
822
  - Default scan dir is `.kiro/reports/release-evidence`, default output file is `.kiro/reports/release-evidence/release-gate-history.json`.
815
823
  - `--history-file` merges an existing index (for example, previous release asset) before dedup/refresh.
816
824
  - `--keep` retains latest N entries (`1-5000`, default `200`).
817
- - Aggregates include scene package batch, drift, and release-preflight/hard-gate signals (`scene_package_batch_*`, `drift_alert_*`, `drift_block_*`, `release_gate_preflight_*`) when present in gate reports.
825
+ - Aggregates include scene package batch, capability unknown trend, drift, and release-preflight/hard-gate signals (`scene_package_batch_*`, `capability_expected_unknown_*`, `capability_provided_unknown_*`, `drift_alert_*`, `drift_block_*`, `release_gate_preflight_*`) when present in gate reports.
818
826
  - `--markdown-out <path>` writes a human-readable trend card markdown for PR/Issue handoff.
819
827
 
820
828
  Moqui template library lexicon audit (script-level governance helper):
821
829
  - `node scripts/moqui-lexicon-audit.js [--manifest <path>] [--template-dir <path>] [--lexicon <path>] [--out <path>] [--markdown-out <path>] [--fail-on-gap] [--json]`: audit manifest/template capability names against canonical Moqui lexicon; reports unknown aliases and uncovered expected capabilities.
830
+ - By default, template capability auditing is scoped to `manifest.templates` (when matched), reducing noise from unrelated templates.
831
+ - Template scope matching normalizes `sce.scene--*` / `kse.scene--*` prefixes, so renamed template namespaces still map correctly.
822
832
 
823
833
  Recommended `.kiro/config/orchestrator.json`:
824
834
 
@@ -17,8 +17,10 @@ sce defaults already enforce the baseline below:
17
17
  - `sce auto handoff run`: requires Moqui baseline portfolio pass by default.
18
18
  - `sce auto handoff run`: enforces Moqui matrix regression hard-gate by default (`max_moqui_matrix_regressions=0`).
19
19
  - `sce auto handoff run`: evaluates capability coverage matrix by default when manifest `capabilities` is declared (default minimum `100%`).
20
+ - `sce auto handoff run` / `sce auto handoff capability-matrix`: enforces capability lexicon normalization by default (expected/provided unknown aliases are blocked unless explicitly bypassed).
20
21
  - `sce auto handoff capability-matrix`: enforces both capability coverage and capability semantic completeness (default minimum `100%` for each).
21
22
  - `sce auto governance stats` / `sce auto governance close-loop`: treats Moqui matrix regressions as first-class risk/block signals (including over-gate stop reasons).
23
+ - `sce auto governance stats` / `sce auto governance close-loop`: treats capability lexicon unknown-count signals as first-class risk/block signals.
22
24
  - `sce scene package-publish-batch`:
23
25
  - ontology validation required by default
24
26
  - batch ontology gate defaults:
@@ -8954,6 +8954,24 @@ function buildAutoHandoffReleaseGateHistoryEntry(entry = {}, options = {}) {
8954
8954
  ? entry.scene_package_batch_failure_count
8955
8955
  : signalMap.scene_package_batch_failure_count
8956
8956
  );
8957
+ const capabilityExpectedUnknownCount = parseAutoHandoffGateNumber(
8958
+ entry.capability_expected_unknown_count !== undefined
8959
+ ? entry.capability_expected_unknown_count
8960
+ : (
8961
+ signalMap.capability_expected_unknown_count !== undefined
8962
+ ? signalMap.capability_expected_unknown_count
8963
+ : signalMap.capability_lexicon_expected_unknown_count
8964
+ )
8965
+ );
8966
+ const capabilityProvidedUnknownCount = parseAutoHandoffGateNumber(
8967
+ entry.capability_provided_unknown_count !== undefined
8968
+ ? entry.capability_provided_unknown_count
8969
+ : (
8970
+ signalMap.capability_provided_unknown_count !== undefined
8971
+ ? signalMap.capability_provided_unknown_count
8972
+ : signalMap.capability_lexicon_provided_unknown_count
8973
+ )
8974
+ );
8957
8975
  const releaseGatePreflightAvailable = parseAutoHandoffGateBoolean(
8958
8976
  entry.release_gate_preflight_available !== undefined
8959
8977
  ? entry.release_gate_preflight_available
@@ -9058,6 +9076,12 @@ function buildAutoHandoffReleaseGateHistoryEntry(entry = {}, options = {}) {
9058
9076
  scene_package_batch_status: sceneBatchStatus || null,
9059
9077
  scene_package_batch_passed: typeof sceneBatchPassed === 'boolean' ? sceneBatchPassed : null,
9060
9078
  scene_package_batch_failure_count: Number.isFinite(sceneBatchFailureCount) ? sceneBatchFailureCount : null,
9079
+ capability_expected_unknown_count: Number.isFinite(capabilityExpectedUnknownCount)
9080
+ ? Math.max(0, Number(capabilityExpectedUnknownCount))
9081
+ : null,
9082
+ capability_provided_unknown_count: Number.isFinite(capabilityProvidedUnknownCount)
9083
+ ? Math.max(0, Number(capabilityProvidedUnknownCount))
9084
+ : null,
9061
9085
  release_gate_preflight_available: typeof releaseGatePreflightAvailable === 'boolean'
9062
9086
  ? releaseGatePreflightAvailable
9063
9087
  : null,
@@ -9220,6 +9244,12 @@ function buildAutoHandoffReleaseGateHistoryAggregates(entries = []) {
9220
9244
  let preflightAvailableRuns = 0;
9221
9245
  let preflightBlockedRuns = 0;
9222
9246
  let preflightHardGateRuns = 0;
9247
+ let capabilityExpectedUnknownKnownRuns = 0;
9248
+ let capabilityExpectedUnknownPositiveRuns = 0;
9249
+ let capabilityProvidedUnknownKnownRuns = 0;
9250
+ let capabilityProvidedUnknownPositiveRuns = 0;
9251
+ const capabilityExpectedUnknownCounts = [];
9252
+ const capabilityProvidedUnknownCounts = [];
9223
9253
  const sceneBatchFailureCounts = [];
9224
9254
  let sceneBatchApplicableCount = 0;
9225
9255
  let sceneBatchPassedCount = 0;
@@ -9268,6 +9298,28 @@ function buildAutoHandoffReleaseGateHistoryAggregates(entries = []) {
9268
9298
  if (Number.isFinite(sceneBatchFailureCount)) {
9269
9299
  sceneBatchFailureCounts.push(sceneBatchFailureCount);
9270
9300
  }
9301
+ const capabilityExpectedUnknownCount = parseAutoHandoffGateNumber(
9302
+ entry && entry.capability_expected_unknown_count
9303
+ );
9304
+ if (Number.isFinite(capabilityExpectedUnknownCount)) {
9305
+ const normalizedCount = Math.max(0, Number(capabilityExpectedUnknownCount));
9306
+ capabilityExpectedUnknownKnownRuns += 1;
9307
+ capabilityExpectedUnknownCounts.push(normalizedCount);
9308
+ if (normalizedCount > 0) {
9309
+ capabilityExpectedUnknownPositiveRuns += 1;
9310
+ }
9311
+ }
9312
+ const capabilityProvidedUnknownCount = parseAutoHandoffGateNumber(
9313
+ entry && entry.capability_provided_unknown_count
9314
+ );
9315
+ if (Number.isFinite(capabilityProvidedUnknownCount)) {
9316
+ const normalizedCount = Math.max(0, Number(capabilityProvidedUnknownCount));
9317
+ capabilityProvidedUnknownKnownRuns += 1;
9318
+ capabilityProvidedUnknownCounts.push(normalizedCount);
9319
+ if (normalizedCount > 0) {
9320
+ capabilityProvidedUnknownPositiveRuns += 1;
9321
+ }
9322
+ }
9271
9323
  const preflightAvailable = parseAutoHandoffGateBoolean(
9272
9324
  entry && entry.release_gate_preflight_available,
9273
9325
  null
@@ -9348,6 +9400,24 @@ function buildAutoHandoffReleaseGateHistoryAggregates(entries = []) {
9348
9400
  const maxSceneBatchFailureCount = sceneBatchFailureCounts.length > 0
9349
9401
  ? Number(Math.max(...sceneBatchFailureCounts).toFixed(2))
9350
9402
  : null;
9403
+ const avgCapabilityExpectedUnknownCount = capabilityExpectedUnknownCounts.length > 0
9404
+ ? Number((capabilityExpectedUnknownCounts.reduce((sum, value) => sum + value, 0) / capabilityExpectedUnknownCounts.length).toFixed(2))
9405
+ : null;
9406
+ const maxCapabilityExpectedUnknownCount = capabilityExpectedUnknownCounts.length > 0
9407
+ ? Number(Math.max(...capabilityExpectedUnknownCounts).toFixed(2))
9408
+ : null;
9409
+ const capabilityExpectedUnknownPositiveRate = capabilityExpectedUnknownKnownRuns > 0
9410
+ ? Number(((capabilityExpectedUnknownPositiveRuns / capabilityExpectedUnknownKnownRuns) * 100).toFixed(2))
9411
+ : null;
9412
+ const avgCapabilityProvidedUnknownCount = capabilityProvidedUnknownCounts.length > 0
9413
+ ? Number((capabilityProvidedUnknownCounts.reduce((sum, value) => sum + value, 0) / capabilityProvidedUnknownCounts.length).toFixed(2))
9414
+ : null;
9415
+ const maxCapabilityProvidedUnknownCount = capabilityProvidedUnknownCounts.length > 0
9416
+ ? Number(Math.max(...capabilityProvidedUnknownCounts).toFixed(2))
9417
+ : null;
9418
+ const capabilityProvidedUnknownPositiveRate = capabilityProvidedUnknownKnownRuns > 0
9419
+ ? Number(((capabilityProvidedUnknownPositiveRuns / capabilityProvidedUnknownKnownRuns) * 100).toFixed(2))
9420
+ : null;
9351
9421
  const driftAlertRate = driftKnownRuns > 0
9352
9422
  ? Number(((driftAlertRuns / driftKnownRuns) * 100).toFixed(2))
9353
9423
  : null;
@@ -9380,6 +9450,16 @@ function buildAutoHandoffReleaseGateHistoryAggregates(entries = []) {
9380
9450
  scene_package_batch_pass_rate_percent: sceneBatchPassRate,
9381
9451
  avg_scene_package_batch_failure_count: avgSceneBatchFailureCount,
9382
9452
  max_scene_package_batch_failure_count: maxSceneBatchFailureCount,
9453
+ capability_expected_unknown_known_runs: capabilityExpectedUnknownKnownRuns,
9454
+ capability_expected_unknown_positive_runs: capabilityExpectedUnknownPositiveRuns,
9455
+ capability_expected_unknown_positive_rate_percent: capabilityExpectedUnknownPositiveRate,
9456
+ avg_capability_expected_unknown_count: avgCapabilityExpectedUnknownCount,
9457
+ max_capability_expected_unknown_count: maxCapabilityExpectedUnknownCount,
9458
+ capability_provided_unknown_known_runs: capabilityProvidedUnknownKnownRuns,
9459
+ capability_provided_unknown_positive_runs: capabilityProvidedUnknownPositiveRuns,
9460
+ capability_provided_unknown_positive_rate_percent: capabilityProvidedUnknownPositiveRate,
9461
+ avg_capability_provided_unknown_count: avgCapabilityProvidedUnknownCount,
9462
+ max_capability_provided_unknown_count: maxCapabilityProvidedUnknownCount,
9383
9463
  drift_known_runs: driftKnownRuns,
9384
9464
  drift_alert_total: driftAlertTotal,
9385
9465
  drift_alert_runs: driftAlertRuns,
@@ -9445,6 +9525,8 @@ async function buildAutoHandoffReleaseGateHistoryIndex(projectPath, options = {}
9445
9525
  risk_level: latestEntry.risk_level,
9446
9526
  scene_package_batch_passed: latestEntry.scene_package_batch_passed,
9447
9527
  scene_package_batch_failure_count: latestEntry.scene_package_batch_failure_count,
9528
+ capability_expected_unknown_count: latestEntry.capability_expected_unknown_count,
9529
+ capability_provided_unknown_count: latestEntry.capability_provided_unknown_count,
9448
9530
  release_gate_preflight_available: latestEntry.release_gate_preflight_available,
9449
9531
  release_gate_preflight_blocked: latestEntry.release_gate_preflight_blocked,
9450
9532
  require_release_gate_preflight: latestEntry.require_release_gate_preflight,
@@ -9490,6 +9572,8 @@ function renderAutoHandoffReleaseGateHistoryMarkdown(payload = {}) {
9490
9572
  lines.push(`- Risk level: ${formatAutoHandoffRegressionValue(latest.risk_level)}`);
9491
9573
  lines.push(`- Scene package batch: ${latest.scene_package_batch_passed === true ? 'pass' : (latest.scene_package_batch_passed === false ? 'fail' : 'n/a')}`);
9492
9574
  lines.push(`- Scene package batch failures: ${formatAutoHandoffRegressionValue(latest.scene_package_batch_failure_count)}`);
9575
+ lines.push(`- Capability expected unknown count: ${formatAutoHandoffRegressionValue(latest.capability_expected_unknown_count, '0')}`);
9576
+ lines.push(`- Capability provided unknown count: ${formatAutoHandoffRegressionValue(latest.capability_provided_unknown_count, '0')}`);
9493
9577
  lines.push(`- Release preflight available: ${latest.release_gate_preflight_available === true ? 'yes' : (latest.release_gate_preflight_available === false ? 'no' : 'n/a')}`);
9494
9578
  lines.push(`- Release preflight blocked: ${latest.release_gate_preflight_blocked === true ? 'yes' : (latest.release_gate_preflight_blocked === false ? 'no' : 'n/a')}`);
9495
9579
  lines.push(`- Release preflight hard-gate: ${latest.require_release_gate_preflight === true ? 'enabled' : (latest.require_release_gate_preflight === false ? 'advisory' : 'n/a')}`);
@@ -9511,6 +9595,12 @@ function renderAutoHandoffReleaseGateHistoryMarkdown(payload = {}) {
9511
9595
  lines.push(`- Scene package batch pass rate: ${formatAutoHandoffRegressionValue(aggregates.scene_package_batch_pass_rate_percent)}%`);
9512
9596
  lines.push(`- Scene package batch failed: ${formatAutoHandoffRegressionValue(aggregates.scene_package_batch_failed_count, '0')}`);
9513
9597
  lines.push(`- Avg scene package batch failures: ${formatAutoHandoffRegressionValue(aggregates.avg_scene_package_batch_failure_count)}`);
9598
+ lines.push(`- Capability expected unknown positive rate: ${formatAutoHandoffRegressionValue(aggregates.capability_expected_unknown_positive_rate_percent)}%`);
9599
+ lines.push(`- Avg capability expected unknown count: ${formatAutoHandoffRegressionValue(aggregates.avg_capability_expected_unknown_count)}`);
9600
+ lines.push(`- Max capability expected unknown count: ${formatAutoHandoffRegressionValue(aggregates.max_capability_expected_unknown_count)}`);
9601
+ lines.push(`- Capability provided unknown positive rate: ${formatAutoHandoffRegressionValue(aggregates.capability_provided_unknown_positive_rate_percent)}%`);
9602
+ lines.push(`- Avg capability provided unknown count: ${formatAutoHandoffRegressionValue(aggregates.avg_capability_provided_unknown_count)}`);
9603
+ lines.push(`- Max capability provided unknown count: ${formatAutoHandoffRegressionValue(aggregates.max_capability_provided_unknown_count)}`);
9514
9604
  lines.push(`- Drift alert runs: ${formatAutoHandoffRegressionValue(aggregates.drift_alert_runs, '0')}`);
9515
9605
  lines.push(`- Drift blocked runs: ${formatAutoHandoffRegressionValue(aggregates.drift_blocked_runs, '0')}`);
9516
9606
  lines.push(`- Drift alert rate: ${formatAutoHandoffRegressionValue(aggregates.drift_alert_rate_percent)}%`);
@@ -9542,6 +9632,14 @@ function renderAutoHandoffReleaseGateHistoryMarkdown(payload = {}) {
9542
9632
  const sceneBatchFailures = formatAutoHandoffRegressionValue(
9543
9633
  entry && entry.scene_package_batch_failure_count
9544
9634
  );
9635
+ const capabilityExpectedUnknown = formatAutoHandoffRegressionValue(
9636
+ entry && entry.capability_expected_unknown_count,
9637
+ '0'
9638
+ );
9639
+ const capabilityProvidedUnknown = formatAutoHandoffRegressionValue(
9640
+ entry && entry.capability_provided_unknown_count,
9641
+ '0'
9642
+ );
9545
9643
  const preflightBlocked = entry && entry.release_gate_preflight_blocked === true
9546
9644
  ? 'yes'
9547
9645
  : (entry && entry.release_gate_preflight_blocked === false ? 'no' : 'n/a');
@@ -9554,7 +9652,8 @@ function renderAutoHandoffReleaseGateHistoryMarkdown(payload = {}) {
9554
9652
  : (entry && entry.drift_blocked === false ? 'no' : 'n/a');
9555
9653
  lines.push(
9556
9654
  `- ${tag} | passed=${passed} | risk=${risk} | scene-batch=${sceneBatch} | ` +
9557
- `scene-failures=${sceneBatchFailures} | preflight-blocked=${preflightBlocked} | hard-gate=${preflightHardGate} | ` +
9655
+ `scene-failures=${sceneBatchFailures} | capability-unknown=${capabilityExpectedUnknown}/${capabilityProvidedUnknown} | ` +
9656
+ `preflight-blocked=${preflightBlocked} | hard-gate=${preflightHardGate} | ` +
9558
9657
  `drift-alerts=${driftAlerts} | drift-blocked=${driftBlocked} | ` +
9559
9658
  `success=${successRate} | violations=${violations} | at=${evaluatedAt}`
9560
9659
  );
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026.02.18",
2
+ "version": "2026.02.18.1",
3
3
  "source": "sce-moqui-core",
4
4
  "capabilities": [
5
5
  {
@@ -8,7 +8,8 @@
8
8
  "order-query-read",
9
9
  "order-read",
10
10
  "moqui-order-query-read",
11
- "moqui-order-read"
11
+ "moqui-order-read",
12
+ "scene.erp.order.query.read"
12
13
  ],
13
14
  "deprecated_aliases": [
14
15
  "order-query",
@@ -21,7 +22,8 @@
21
22
  "order-fulfillment-workflow",
22
23
  "order-fulfillment",
23
24
  "fulfillment-workflow",
24
- "moqui-order-fulfillment"
25
+ "moqui-order-fulfillment",
26
+ "scene.erp.order.fulfillment.workflow"
25
27
  ],
26
28
  "deprecated_aliases": [
27
29
  "order-fulfilment-workflow",
@@ -34,7 +36,8 @@
34
36
  "inventory-reserve-adjust",
35
37
  "inventory-adjust",
36
38
  "inventory-reserve",
37
- "moqui-inventory-reserve-adjust"
39
+ "moqui-inventory-reserve-adjust",
40
+ "scene.erp.inventory.reserve.adjust"
38
41
  ],
39
42
  "deprecated_aliases": [
40
43
  "inventory-adjustment",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scene-capability-engine",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
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": {