scene-capability-engine 3.0.2 → 3.0.3

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
@@ -8,7 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  ## [Unreleased]
9
9
 
10
10
  ### Added
11
+ - **Capability lexicon hard gate end-to-end defaultization**: `sce auto handoff run` and `sce auto handoff capability-matrix` now enforce unknown Moqui capability alias blocking by default (expected/provided), emit lexicon gate telemetry into release evidence, and promote those signals into governance risk/concern/recommendation/close-loop block decisions.
11
12
  - **SCE naming consolidation + compatibility bridge**: Rebranded product naming to `Scene Capability Engine`, moved package to `scene-capability-engine`, promoted `sce` as the primary CLI command, and preserved `sco` / `sce` / `scene-capability-engine` aliases for migration continuity.
13
+ - **Official template library v1.5.0 alignment**: Synced with `scene-capability-engine-templates` `v1.5.0`, adding scene orchestration template coverage for canvas visualization, interaction hardening, execution playbook, dependency drilldown, decision cockpit, runbook export, action queue orchestration, action pack export, and unified scene governance closure.
12
14
  - **Branding consistency release guard**: Added `test:brand-consistency` to block publish when legacy repository/package/product naming reappears in tracked source files.
13
15
  - **Rate-limit launch budget safety guard**: Hardened orchestration launch-budget bookkeeping to safely handle partially initialized engine instances in property/instrumentation scenarios.
14
16
  - **Property test CI stability (`orchestration-engine.property`)**: Disabled launch-budget waiting in parallel invariant property harness to avoid artificial 60s hold windows and intermittent Jest worker crashes under high-concurrency CI runs.
@@ -724,7 +724,13 @@ Close-loop controller session maintenance:
724
724
 
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
- - JSON output includes `totals`, `throughput`, `health` (`risk_level`, `concerns`, `recommendations`, `release_gate`), `top_master_specs`, `recovery_memory`, and full per-archive stats under `archives`.
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:
729
+ - `latest_moqui_matrix_regression_count`
730
+ - `latest_moqui_matrix_regression_gate_max`
731
+ - `avg_moqui_matrix_regression_count`
732
+ - `max_moqui_matrix_regression_count`
733
+ - `moqui_matrix_regression_positive_rate_percent`
728
734
  - `sce auto governance maintain [--days <n>] [--status <csv>] [--session-keep <n>] [--batch-session-keep <n>] [--controller-session-keep <n>] [--recovery-memory-older-than-days <n>] [--apply] [--dry-run] [--json]`: run governance-maintenance planning and optional execution in one command.
729
735
  - Plan-only mode is default; add `--apply` to execute maintenance actions (`session prune`, `batch-session prune`, `controller-session prune`, `recovery-memory prune`).
730
736
  - When release gate is blocked, plan output prioritizes release remediation advisories (`release-gate-evidence-review`, `release-gate-scene-batch-remediate`) before routine cleanup actions.
@@ -736,6 +742,9 @@ Cross-archive autonomous governance maintenance:
736
742
  - `--governance-session-keep` (with optional `--governance-session-older-than-days`) enables post-run governance session retention pruning while protecting the current session snapshot.
737
743
  - `--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.
738
744
  - 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
+ - Release-gate block reasons now include handoff matrix regression reasons when present:
746
+ - `handoff-moqui-matrix-regressions-positive:<n>`
747
+ - `handoff-moqui-matrix-regressions-over-gate:<n>/<max>`
739
748
  - `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).
740
749
  - `sce auto governance session stats [--days <n>] [--status <csv>] [--resume-only] [--json]`: aggregate governance close-loop session telemetry (completion/failure/convergence, rounds, risk/stop composition, resumed-chain ratios/source counts, and aggregated `release_gate` round telemetry trends).
741
750
  - `sce auto governance session prune [--keep <n>] [--older-than-days <n>] [--dry-run] [--json]`: prune governance close-loop session archive by retention policy.
@@ -770,19 +779,21 @@ Dual-track handoff integration:
770
779
  - `sce auto handoff queue --manifest <path> [--out <path>] [--append] [--no-include-known-gaps] [--dry-run] [--json]`: generate close-loop batch goal queue from handoff manifest and optionally persist line-based queue file (default `.kiro/auto/handoff-goals.lines`).
771
780
  - `sce auto handoff template-diff --manifest <path> [--json]`: compare manifest templates against local template exports/registry and report `missing_in_local` and `extra_in_local`.
772
781
  - `sce auto handoff capability-matrix --manifest <path> [--strict] [--strict-warnings] [--min-capability-coverage <n>] [--min-capability-semantic <n>] [--no-require-capability-semantic] [--format <json|markdown>] [--out <path>] [--remediation-queue-out <path>] [--fail-on-gap] [--json]`: generate a fast Moqui capability matrix (`template-diff + baseline + capability coverage + semantic completeness`) and optionally fail fast on gaps.
773
- - `sce auto handoff run --manifest <path> [--out <path>] [--queue-out <path>] [--append] [--no-include-known-gaps] [--continue-from <session|latest|file>] [--continue-strategy <auto|pending|failed-only>] [--dry-run] [--strict] [--strict-warnings] [--no-dependency-batching] [--min-spec-success-rate <n>] [--max-risk-level <level>] [--no-require-ontology-validation] [--no-require-moqui-baseline] [--min-capability-coverage <n>] [--no-require-capability-coverage] [--require-release-gate-preflight] [--release-evidence-window <n>] [--json]`: execute handoff end-to-end (`plan -> queue -> close-loop-batch -> observability`) with automatic report archive to `.kiro/reports/handoff-runs/<session>.json`.
782
+ - `sce auto handoff run --manifest <path> [--out <path>] [--queue-out <path>] [--append] [--no-include-known-gaps] [--continue-from <session|latest|file>] [--continue-strategy <auto|pending|failed-only>] [--dry-run] [--strict] [--strict-warnings] [--no-dependency-batching] [--min-spec-success-rate <n>] [--max-risk-level <level>] [--max-moqui-matrix-regressions <n>] [--no-require-ontology-validation] [--no-require-moqui-baseline] [--min-capability-coverage <n>] [--no-require-capability-coverage] [--require-release-gate-preflight] [--release-evidence-window <n>] [--json]`: execute handoff end-to-end (`plan -> queue -> close-loop-batch -> observability`) with automatic report archive to `.kiro/reports/handoff-runs/<session>.json`.
774
783
  - Default mode is dependency-aware: spec integration goals are grouped into dependency batches and executed in topological order.
775
784
  - `--continue-from` resumes pending goals from an existing handoff run report (`latest`, session id, or JSON file path). For safety, sce enforces manifest-path consistency between the previous report and current run.
776
785
  - `--continue-strategy auto|pending|failed-only` controls resumed scope. `auto` (default) derives the best strategy from prior run state (`pending` when unprocessed/planned goals exist, otherwise `failed-only` for pure failure replay).
777
786
  - Non-dry runs auto-merge release evidence into `.kiro/reports/release-evidence/handoff-runs.json` with session-level gate/ontology/regression/moqui-baseline/capability-coverage snapshots. Merge failures are recorded as warnings without aborting the run.
778
787
  - `--release-evidence-window` controls trend snapshot window size (2-50, default `5`) used in merged release evidence (`latest_trend_window` and per-session `trend_window`).
779
788
  - Run output includes `moqui_baseline` snapshot by default, with artifacts at `.kiro/reports/release-evidence/moqui-template-baseline.json` and `.kiro/reports/release-evidence/moqui-template-baseline.md`.
789
+ - `moqui_baseline.summary` now includes `scope_breakdown`, `coverage_matrix`, and `gap_frequency` for ER/BR/decision closure tracking.
790
+ - `moqui_baseline.compare` now includes `coverage_matrix_deltas` and `coverage_matrix_regressions` for trend-level entity/relation/rule/decision closure movement and negative-delta alerts (used by matrix-regression hard gate).
780
791
  - Run output includes `moqui_capability_coverage` snapshot by default (when manifest `capabilities` is declared), with artifacts at `.kiro/reports/release-evidence/moqui-capability-coverage.json` and `.kiro/reports/release-evidence/moqui-capability-coverage.md`.
781
792
  - Run output includes `release_gate_preflight` (latest release gate history signal snapshot + blocked reasons) and carries this context into `warnings`.
782
793
  - `release_gate_preflight` is advisory by default; use `--require-release-gate-preflight` to hard-fail when preflight is unavailable/blocked.
783
794
  - When Moqui baseline/capability gates fail, sce auto-generates remediation queue lines at `.kiro/auto/moqui-remediation.lines`.
784
795
  - Run result includes `failure_summary` (failed phase/gate/release-gate preflight highlights) and `recommendations` with executable follow-up commands (for example, auto-generated `--continue-from <session>` on failed/incomplete batches).
785
- - Gate defaults: `--min-spec-success-rate` defaults to `100`, `--max-risk-level` defaults to `high`, ontology validation requirement is enabled by default, Moqui baseline requirement is enabled by default, and capability coverage minimum defaults to `100` when manifest `capabilities` is declared.
796
+ - Gate defaults: `--min-spec-success-rate` defaults to `100`, `--max-risk-level` defaults to `high`, `--max-moqui-matrix-regressions` defaults to `0`, ontology validation requirement is enabled by default, Moqui baseline requirement is enabled by default, and capability coverage minimum defaults to `100` when manifest `capabilities` is declared.
786
797
  - Use `--no-require-ontology-validation`, `--no-require-moqui-baseline`, or `--no-require-capability-coverage` only for emergency bypass.
787
798
  - `sce auto handoff regression [--session-id <id|latest>] [--window <n>] [--format <json|markdown>] [--out <path>] [--json]`: compare one handoff run report with its previous run and output trend deltas (success-rate/risk/failed-goals/elapsed time).
788
799
  - `--window` (2-50, default `2`) returns multi-run `series`, `window_trend`, and `aggregates` for broader regression visibility.
@@ -806,6 +817,9 @@ Dual-track handoff integration:
806
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.
807
818
  - `--markdown-out <path>` writes a human-readable trend card markdown for PR/Issue handoff.
808
819
 
820
+ Moqui template library lexicon audit (script-level governance helper):
821
+ - `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.
822
+
809
823
  Recommended `.kiro/config/orchestrator.json`:
810
824
 
811
825
  ```json
@@ -904,13 +918,14 @@ sce scene package-ontology-backfill-batch --from-331 --dry-run --out-report .kir
904
918
  ### Moqui Template Baseline Scorecard
905
919
 
906
920
  ```bash
907
- # Preferred CLI entry: score Moqui/ERP templates in the local template library (default filter: moqui|erp)
921
+ # Preferred CLI entry: score Moqui + scene orchestration templates in the local template library
922
+ # (default filter: moqui|erp|suite|playbook|runbook|decision|action|governance)
908
923
  sce scene moqui-baseline --json
909
924
 
910
925
  # Script alias (same behavior)
911
926
  npm run report:moqui-baseline
912
927
 
913
- # Score all scene templates instead of Moqui/ERP subset
928
+ # Score all scene templates instead of the default Moqui + orchestration subset
914
929
  sce scene moqui-baseline --include-all --json
915
930
 
916
931
  # Customize score thresholds and output paths
Binary file
@@ -15,6 +15,27 @@ This document defines the execution boundary for converting Moqui capabilities i
15
15
  | P0 | Order read (`OrderHeader`, `OrderItem`, query services) | `query` | `sce.scene--erp-order-query-read--0.1.0` | `order_header`, `order_item`, `order_projection`, `customer_party` | low risk, idempotent query, lineage complete | template-ready |
16
16
  | P0 | Order fulfillment (reserve, payment, release) | `workflow` | `sce.scene--erp-order-fulfillment-workflow--0.1.0` | `order_header`, `order_item`, `inventory_reservation`, `payment_authorization`, `fulfillment_execution` | medium risk, approval required, compensation strategy | template-ready |
17
17
  | P0 | Inventory reserve + adjust | `workflow/crud hybrid` | `sce.scene--erp-inventory-reserve-adjust--0.1.0` | `inventory_item`, `inventory_reservation`, `inventory_adjustment`, `inventory_snapshot` | medium risk, approval required, non-negative stock rule | template-ready |
18
+ | P1 | Party master (`Party`, `PartyRole`) | `crud` | `sce.scene--erp-party-management--0.1.0` | `party`, `party_role`, `party_relationship` | medium risk, merge/dedup strategy required | matrix-intake-ready |
19
+ | P1 | Product master (`Product`, classification/pricing) | `crud` | `sce.scene--erp-product-management--0.1.0` | `product`, `product_category`, `price_rule` | medium risk, version consistency, rule closure | matrix-intake-ready |
20
+ | P1 | Procurement + supplier flow | `workflow` | `sce.scene--erp-procurement-management--0.1.0` | `purchase_order`, `supplier_party`, `receipt_line` | medium risk, approval + receipt reconciliation | matrix-intake-ready |
21
+ | P1 | Shipment execution + tracking | `workflow` | `sce.scene--erp-shipment-management--0.1.0` | `shipment`, `shipment_item`, `fulfillment_event` | medium risk, irreversible step guard | matrix-intake-ready |
22
+ | P1 | Return/RMA handling | `workflow` | `sce.scene--erp-return-rma-management--0.1.0` | `return_header`, `return_item`, `refund_decision` | medium risk, policy decision completeness | matrix-intake-ready |
23
+ | P1 | Production run + work order execution | `workflow` | `sce.scene--erp-production-run--0.1.0` | `production_run`, `work_effort`, `material_issue` | high risk, capacity/exception path required | matrix-intake-ready |
24
+ | P1 | BOM + routing maintenance | `crud/workflow hybrid` | `sce.scene--erp-bom-routing-management--0.1.0` | `bom`, `routing`, `operation_step` | medium risk, effective-date governance | matrix-intake-ready |
25
+ | P1 | Quality inspection + hold/release | `decision workflow` | `sce.scene--erp-quality-inspection--0.1.0` | `inspection_lot`, `quality_rule`, `release_decision` | high risk, decision closure mandatory | matrix-intake-ready |
26
+ | P1 | Equipment lifecycle + maintenance | `workflow` | `sce.scene--erp-equipment-management--0.1.0` | `equipment_asset`, `maintenance_order`, `downtime_event` | medium risk, safety/approval policy | matrix-intake-ready |
27
+ | P2 | Workflow approval engine | `platform service` | `sce.scene--platform-workflow-approval-engine--0.1.0` | `approval_flow`, `approval_node`, `approval_decision` | high risk, branch decision coverage | matrix-intake-ready |
28
+ | P2 | Reporting + audit operations | `platform query` | `sce.scene--platform-reporting-audit-ops--0.1.0` | `audit_event`, `report_slice`, `trace_lineage` | low risk, lineage completeness | matrix-intake-ready |
29
+ | P2 | Suite observability/parity audit | `platform query/dashboard` | `sce.scene--platform-suite-observability-parity--0.1.0` | `suite_capability`, `parity_audit`, `scene_coverage` | medium risk, regression signal quality | matrix-intake-ready |
30
+
31
+ ## 331-poc Intake Snapshot
32
+
33
+ - Source baseline: `331-poc/docs/handoffs/handoff-manifest.json` (timestamp `2026-02-18T01:08:00+08:00`).
34
+ - Newly aligned domain set in this round: party/product/order/procurement/inventory/production/quality/equipment/cost/engineering/hr/calendar + suite platform governance templates.
35
+ - Core landing contract:
36
+ - capability aliases are normalized through `lib/data/moqui-capability-lexicon.json`
37
+ - handoff run default gate keeps `max_moqui_matrix_regressions=0`
38
+ - governance stats/close-loop consumes matrix regression signals as release-block conditions
18
39
 
19
40
  ## Ownership Boundary
20
41
 
@@ -15,8 +15,10 @@ sce defaults already enforce the baseline below:
15
15
  - `sce auto handoff run`: ontology validation is required by default.
16
16
  - `sce auto handoff run`: generates Moqui baseline snapshot by default and appends it to release-evidence sessions.
17
17
  - `sce auto handoff run`: requires Moqui baseline portfolio pass by default.
18
+ - `sce auto handoff run`: enforces Moqui matrix regression hard-gate by default (`max_moqui_matrix_regressions=0`).
18
19
  - `sce auto handoff run`: evaluates capability coverage matrix by default when manifest `capabilities` is declared (default minimum `100%`).
19
20
  - `sce auto handoff capability-matrix`: enforces both capability coverage and capability semantic completeness (default minimum `100%` for each).
21
+ - `sce auto governance stats` / `sce auto governance close-loop`: treats Moqui matrix regressions as first-class risk/block signals (including over-gate stop reasons).
20
22
  - `sce scene package-publish-batch`:
21
23
  - ontology validation required by default
22
24
  - batch ontology gate defaults:
@@ -32,7 +34,7 @@ Emergency bypass exists but is not recommended:
32
34
  ## One-Shot Intake Flow
33
35
 
34
36
  ```bash
35
- # 0) Generate template baseline scoreboard (Moqui/ERP templates by default)
37
+ # 0) Generate template baseline scoreboard (Moqui + scene orchestration templates by default)
36
38
  sce scene moqui-baseline --json
37
39
 
38
40
  # 0.1) CI/release mode: compare against previous baseline and enforce portfolio gate
@@ -49,9 +51,22 @@ sce auto handoff capability-matrix \
49
51
  --fail-on-gap \
50
52
  --json
51
53
 
54
+ # 0.3) Capability lexicon audit (expected/provided canonical alignment)
55
+ node scripts/moqui-lexicon-audit.js \
56
+ --manifest docs/handoffs/handoff-manifest.json \
57
+ --template-dir .kiro/templates/scene-packages \
58
+ --fail-on-gap \
59
+ --json
60
+
52
61
  # 1) Handoff close-loop
53
62
  sce auto handoff run --manifest docs/handoffs/handoff-manifest.json --json
54
63
 
64
+ # 1.1) Explicitly keep strict matrix hard-gate (same as default, recommended in CI)
65
+ sce auto handoff run \
66
+ --manifest docs/handoffs/handoff-manifest.json \
67
+ --max-moqui-matrix-regressions 0 \
68
+ --json
69
+
55
70
  # 2) Publish templates from scene packages (with default ontology gates)
56
71
  sce scene package-publish-batch \
57
72
  --manifest docs/handoffs/handoff-manifest.json \
@@ -80,6 +95,8 @@ Required artifacts for each intake batch:
80
95
  - `.kiro/reports/release-evidence/moqui-template-baseline.md`
81
96
  - `.kiro/reports/release-evidence/moqui-capability-coverage.json`
82
97
  - `.kiro/reports/release-evidence/moqui-capability-coverage.md`
98
+ - `.kiro/reports/release-evidence/moqui-lexicon-audit.json`
99
+ - `.kiro/reports/release-evidence/moqui-lexicon-audit.md`
83
100
  - `.kiro/reports/handoff-capability-matrix.md` (or JSON equivalent from `sce auto handoff capability-matrix`)
84
101
  - `.kiro/reports/handoff-runs/<session>.json`
85
102
  - `.kiro/reports/scene-package-ontology-batch.json`
@@ -87,6 +104,17 @@ Required artifacts for each intake batch:
87
104
  - `.kiro/templates/scene-packages/registry.json`
88
105
  - gate output/evidence linked from release notes or handoff summary
89
106
 
107
+ `moqui-template-baseline.json` summary should be consumed as a matrix gate:
108
+ - `scope_breakdown` (moqui_erp / scene_orchestration / other)
109
+ - `coverage_matrix` (entity/relation/business-rule/decision coverage and closure rates)
110
+ - `gap_frequency` (top recurring ontology gaps for remediation prioritization)
111
+ - `compare.coverage_matrix_deltas` (trend deltas used to detect matrix regression/plateau between runs)
112
+ - `compare.coverage_matrix_regressions` (negative-delta signals consumed by auto remediation/recommendation flows)
113
+ - default handoff hard-gate enforces `max_moqui_matrix_regressions=0` unless explicitly relaxed
114
+ - governance close-loop block reasons include:
115
+ - `handoff-moqui-matrix-regressions-positive:<n>`
116
+ - `handoff-moqui-matrix-regressions-over-gate:<n>/<max>`
117
+
90
118
  ## Minimum Semantic Coverage
91
119
 
92
120
  Each accepted template should include ontology semantics for: