scene-capability-engine 3.0.2 → 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.
@@ -61,7 +61,7 @@ const SCENE_PACKAGE_KINDS = new Set([
61
61
  const SCENE_PACKAGE_RISK_LEVELS = new Set(['low', 'medium', 'high', 'critical']);
62
62
  const SCENE_PACKAGE_TEMPLATE_API_VERSION = 'sce.scene.template/v0.1';
63
63
  const SCENE_PACKAGE_TEMPLATE_DEFAULT_DIR = '.kiro/templates/scene-packages';
64
- const SCENE_MOQUI_BASELINE_DEFAULT_MATCH = '(moqui|erp)';
64
+ const SCENE_MOQUI_BASELINE_DEFAULT_MATCH = '(moqui|erp|suite|playbook|runbook|decision|action|governance)';
65
65
  const SCENE_MOQUI_BASELINE_DEFAULT_MIN_SCORE = 70;
66
66
  const SCENE_MOQUI_BASELINE_DEFAULT_MIN_VALID_RATE = 100;
67
67
  const SCENE_PACKAGE_BATCH_DEFAULT_ONTOLOGY_MIN_AVERAGE_SCORE = 70;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026.02.17",
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,12 +36,269 @@
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",
41
44
  "inventory-reservation-adjustment"
42
45
  ]
46
+ },
47
+ {
48
+ "canonical": "erp-party-management",
49
+ "aliases": [
50
+ "party-management",
51
+ "party-master",
52
+ "party-domain-management",
53
+ "moqui-party-management"
54
+ ],
55
+ "deprecated_aliases": [
56
+ "party-mgmt"
57
+ ]
58
+ },
59
+ {
60
+ "canonical": "erp-product-management",
61
+ "aliases": [
62
+ "product-management",
63
+ "product-master-management",
64
+ "moqui-product-management"
65
+ ],
66
+ "deprecated_aliases": [
67
+ "product-mgmt"
68
+ ]
69
+ },
70
+ {
71
+ "canonical": "erp-order-management",
72
+ "aliases": [
73
+ "order-management",
74
+ "moqui-order-management"
75
+ ],
76
+ "deprecated_aliases": [
77
+ "order-mgmt"
78
+ ]
79
+ },
80
+ {
81
+ "canonical": "erp-shipment-management",
82
+ "aliases": [
83
+ "shipment-management",
84
+ "shipment-flow-management",
85
+ "moqui-shipment-management"
86
+ ],
87
+ "deprecated_aliases": [
88
+ "shipment-mgmt"
89
+ ]
90
+ },
91
+ {
92
+ "canonical": "erp-return-rma-management",
93
+ "aliases": [
94
+ "return-rma-management",
95
+ "rma-management",
96
+ "return-management",
97
+ "moqui-return-rma-management"
98
+ ],
99
+ "deprecated_aliases": [
100
+ "return-rma"
101
+ ]
102
+ },
103
+ {
104
+ "canonical": "erp-accounting-invoice",
105
+ "aliases": [
106
+ "accounting-invoice",
107
+ "invoice-management",
108
+ "moqui-accounting-invoice"
109
+ ],
110
+ "deprecated_aliases": [
111
+ "invoice-accounting"
112
+ ]
113
+ },
114
+ {
115
+ "canonical": "erp-procurement-management",
116
+ "aliases": [
117
+ "procurement-management",
118
+ "purchase-management",
119
+ "moqui-procurement-management"
120
+ ],
121
+ "deprecated_aliases": [
122
+ "procurement-mgmt"
123
+ ]
124
+ },
125
+ {
126
+ "canonical": "erp-inventory-management",
127
+ "aliases": [
128
+ "inventory-management",
129
+ "facility-inventory",
130
+ "moqui-inventory-management"
131
+ ],
132
+ "deprecated_aliases": [
133
+ "inventory-mgmt"
134
+ ]
135
+ },
136
+ {
137
+ "canonical": "erp-production-run",
138
+ "aliases": [
139
+ "production-run",
140
+ "production-execution",
141
+ "moqui-production-run"
142
+ ],
143
+ "deprecated_aliases": [
144
+ "production-job-run"
145
+ ]
146
+ },
147
+ {
148
+ "canonical": "erp-bom-management",
149
+ "aliases": [
150
+ "bom-management",
151
+ "bill-of-material-management",
152
+ "moqui-bom-management"
153
+ ],
154
+ "deprecated_aliases": [
155
+ "bom-mgmt"
156
+ ]
157
+ },
158
+ {
159
+ "canonical": "erp-routing-management",
160
+ "aliases": [
161
+ "routing-management",
162
+ "production-routing-management",
163
+ "moqui-routing-management"
164
+ ],
165
+ "deprecated_aliases": [
166
+ "routing-mgmt"
167
+ ]
168
+ },
169
+ {
170
+ "canonical": "erp-quality-inspection",
171
+ "aliases": [
172
+ "quality-inspection",
173
+ "quality-gate-inspection",
174
+ "moqui-quality-inspection"
175
+ ],
176
+ "deprecated_aliases": [
177
+ "quality-inspect"
178
+ ]
179
+ },
180
+ {
181
+ "canonical": "erp-equipment-management",
182
+ "aliases": [
183
+ "equipment-management",
184
+ "asset-equipment-management",
185
+ "moqui-equipment-management"
186
+ ],
187
+ "deprecated_aliases": [
188
+ "equipment-mgmt"
189
+ ]
190
+ },
191
+ {
192
+ "canonical": "erp-cost-management",
193
+ "aliases": [
194
+ "cost-management",
195
+ "costing-management",
196
+ "moqui-cost-management"
197
+ ],
198
+ "deprecated_aliases": [
199
+ "cost-mgmt"
200
+ ]
201
+ },
202
+ {
203
+ "canonical": "erp-engineering-change",
204
+ "aliases": [
205
+ "engineering-change",
206
+ "engineering-change-management",
207
+ "moqui-engineering-change"
208
+ ],
209
+ "deprecated_aliases": [
210
+ "ecm-management"
211
+ ]
212
+ },
213
+ {
214
+ "canonical": "erp-hr-employee-management",
215
+ "aliases": [
216
+ "hr-employee-management",
217
+ "employee-management",
218
+ "moqui-hr-employee-management"
219
+ ],
220
+ "deprecated_aliases": [
221
+ "employee-hr-management"
222
+ ]
223
+ },
224
+ {
225
+ "canonical": "erp-work-calendar",
226
+ "aliases": [
227
+ "work-calendar",
228
+ "calendar-management",
229
+ "moqui-work-calendar"
230
+ ],
231
+ "deprecated_aliases": [
232
+ "work-schedule-calendar"
233
+ ]
234
+ },
235
+ {
236
+ "canonical": "platform-workflow-approval-engine",
237
+ "aliases": [
238
+ "workflow-approval-engine",
239
+ "workflow-approval",
240
+ "approval-engine",
241
+ "moqui-workflow-approval-engine"
242
+ ],
243
+ "deprecated_aliases": [
244
+ "workflow-approval-center"
245
+ ]
246
+ },
247
+ {
248
+ "canonical": "platform-reporting-audit-ops",
249
+ "aliases": [
250
+ "reporting-audit-ops",
251
+ "audit-ops",
252
+ "ops-audit-reporting",
253
+ "moqui-reporting-audit-ops"
254
+ ],
255
+ "deprecated_aliases": [
256
+ "audit-reporting-ops"
257
+ ]
258
+ },
259
+ {
260
+ "canonical": "platform-data-migration-domestic-validation",
261
+ "aliases": [
262
+ "data-migration-domestic-validation",
263
+ "data-migration-validation",
264
+ "moqui-data-migration-domestic-validation"
265
+ ],
266
+ "deprecated_aliases": [
267
+ "domestic-data-migration-validation"
268
+ ]
269
+ },
270
+ {
271
+ "canonical": "platform-suite-hub-ui-integration",
272
+ "aliases": [
273
+ "suite-hub-ui-integration",
274
+ "suite-hub-ui",
275
+ "moqui-suite-hub-ui-integration"
276
+ ],
277
+ "deprecated_aliases": [
278
+ "suite-ui-hub-integration"
279
+ ]
280
+ },
281
+ {
282
+ "canonical": "platform-suite-capability-observability",
283
+ "aliases": [
284
+ "suite-capability-observability",
285
+ "capability-observability",
286
+ "moqui-suite-capability-observability"
287
+ ],
288
+ "deprecated_aliases": [
289
+ "suite-capability-visibility"
290
+ ]
291
+ },
292
+ {
293
+ "canonical": "platform-suite-native-ui-parity-audit",
294
+ "aliases": [
295
+ "suite-native-ui-parity-audit",
296
+ "native-ui-parity-audit",
297
+ "moqui-suite-native-ui-parity-audit"
298
+ ],
299
+ "deprecated_aliases": [
300
+ "suite-ui-parity-audit"
301
+ ]
43
302
  }
44
303
  ]
45
304
  }
@@ -24,6 +24,8 @@ const DEFAULT_RATE_LIMIT_PARALLEL_FLOOR = 1;
24
24
  const DEFAULT_RATE_LIMIT_COOLDOWN_MS = 30000;
25
25
  const DEFAULT_RATE_LIMIT_LAUNCH_BUDGET_PER_MINUTE = 12;
26
26
  const DEFAULT_RATE_LIMIT_LAUNCH_BUDGET_WINDOW_MS = 60000;
27
+ const DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS = 600;
28
+ const AGENT_WAIT_TIMEOUT_GRACE_MS = 30000;
27
29
  const RATE_LIMIT_BACKOFF_JITTER_RATIO = 0.5;
28
30
  const RATE_LIMIT_RETRY_AFTER_MAX_MS = 10 * 60 * 1000;
29
31
  const RATE_LIMIT_ERROR_PATTERNS = [
@@ -104,6 +106,8 @@ class OrchestrationEngine extends EventEmitter {
104
106
  this._launchBudgetLastHoldSignalAt = 0;
105
107
  /** @type {number} last launch-budget hold duration emitted to telemetry (ms) */
106
108
  this._launchBudgetLastHoldMs = 0;
109
+ /** @type {number} fallback wait timeout to avoid indefinite hangs when lifecycle events are missing */
110
+ this._agentWaitTimeoutMs = (DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS * 1000) + AGENT_WAIT_TIMEOUT_GRACE_MS;
107
111
  /** @type {() => number} */
108
112
  this._random = typeof options.random === 'function' ? options.random : Math.random;
109
113
  /** @type {() => number} */
@@ -190,6 +194,7 @@ class OrchestrationEngine extends EventEmitter {
190
194
  // Get config for maxParallel and maxRetries
191
195
  const config = await this._orchestratorConfig.getConfig();
192
196
  this._applyRetryPolicyConfig(config);
197
+ this._agentWaitTimeoutMs = this._resolveAgentWaitTimeoutMs(config);
193
198
  const maxParallel = options.maxParallel || config.maxParallel || 3;
194
199
  const maxRetries = config.maxRetries || 2;
195
200
  this._initializeAdaptiveParallel(maxParallel);
@@ -407,29 +412,46 @@ class OrchestrationEngine extends EventEmitter {
407
412
  */
408
413
  _waitForAgent(specName, agentId) {
409
414
  return new Promise((resolve) => {
415
+ const fallbackTimeoutMs = this._toPositiveInteger(
416
+ this._agentWaitTimeoutMs,
417
+ (DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS * 1000) + AGENT_WAIT_TIMEOUT_GRACE_MS
418
+ );
419
+ let settled = false;
420
+ let fallbackTimer = null;
421
+
422
+ const finalize = (payload) => {
423
+ if (settled) {
424
+ return;
425
+ }
426
+ settled = true;
427
+ cleanup();
428
+ resolve(payload);
429
+ };
430
+
410
431
  const onCompleted = (data) => {
411
432
  if (data.agentId === agentId) {
412
- cleanup();
413
- resolve({ status: 'completed', error: null });
433
+ finalize({ status: 'completed', error: null });
414
434
  }
415
435
  };
416
436
 
417
437
  const onFailed = (data) => {
418
438
  if (data.agentId === agentId) {
419
- cleanup();
420
439
  const error = data.stderr || data.error || `Exit code: ${data.exitCode}`;
421
- resolve({ status: 'failed', error });
440
+ finalize({ status: 'failed', error });
422
441
  }
423
442
  };
424
443
 
425
444
  const onTimeout = (data) => {
426
445
  if (data.agentId === agentId) {
427
- cleanup();
428
- resolve({ status: 'timeout', error: `Timeout after ${data.timeoutSeconds}s` });
446
+ finalize({ status: 'timeout', error: `Timeout after ${data.timeoutSeconds}s` });
429
447
  }
430
448
  };
431
449
 
432
450
  const cleanup = () => {
451
+ if (fallbackTimer) {
452
+ clearTimeout(fallbackTimer);
453
+ fallbackTimer = null;
454
+ }
433
455
  this._agentSpawner.removeListener('agent:completed', onCompleted);
434
456
  this._agentSpawner.removeListener('agent:failed', onFailed);
435
457
  this._agentSpawner.removeListener('agent:timeout', onTimeout);
@@ -438,6 +460,16 @@ class OrchestrationEngine extends EventEmitter {
438
460
  this._agentSpawner.on('agent:completed', onCompleted);
439
461
  this._agentSpawner.on('agent:failed', onFailed);
440
462
  this._agentSpawner.on('agent:timeout', onTimeout);
463
+
464
+ fallbackTimer = setTimeout(() => {
465
+ finalize({
466
+ status: 'timeout',
467
+ error: (
468
+ `Agent wait timeout after ${Math.ceil(fallbackTimeoutMs / 1000)}s for ` +
469
+ `${specName} (${agentId}) without lifecycle events`
470
+ ),
471
+ });
472
+ }, fallbackTimeoutMs);
441
473
  });
442
474
  }
443
475
 
@@ -689,6 +721,23 @@ class OrchestrationEngine extends EventEmitter {
689
721
  );
690
722
  }
691
723
 
724
+ /**
725
+ * Resolve a fallback wait timeout for _waitForAgent.
726
+ * This protects orchestration from hanging forever if lifecycle events
727
+ * are unexpectedly missing.
728
+ *
729
+ * @param {object} config
730
+ * @returns {number}
731
+ * @private
732
+ */
733
+ _resolveAgentWaitTimeoutMs(config) {
734
+ const timeoutSeconds = this._toPositiveInteger(
735
+ config && config.timeoutSeconds,
736
+ DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS
737
+ );
738
+ return (timeoutSeconds * 1000) + AGENT_WAIT_TIMEOUT_GRACE_MS;
739
+ }
740
+
692
741
  /**
693
742
  * @param {number} maxParallel
694
743
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scene-capability-engine",
3
- "version": "3.0.2",
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": {