scene-capability-engine 3.6.4 → 3.6.7
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 +49 -0
- package/README.md +1 -0
- package/README.zh.md +1 -0
- package/docs/command-reference.md +13 -1
- package/lib/gitignore/gitignore-detector.js +2 -1
- package/lib/gitignore/layered-rules-template.js +1 -0
- package/lib/state/sce-state-store.js +1077 -0
- package/lib/state/state-migration-manager.js +334 -3
- package/package.json +1 -1
|
@@ -7,6 +7,12 @@ const { SessionStore } = require('../runtime/session-store');
|
|
|
7
7
|
const COMPONENT_AGENT_REGISTRY = 'collab.agent-registry';
|
|
8
8
|
const COMPONENT_TIMELINE_INDEX = 'runtime.timeline-index';
|
|
9
9
|
const COMPONENT_SCENE_SESSION_INDEX = 'runtime.scene-session-index';
|
|
10
|
+
const COMPONENT_ERRORBOOK_ENTRY_INDEX = 'errorbook.entry-index';
|
|
11
|
+
const COMPONENT_ERRORBOOK_INCIDENT_INDEX = 'errorbook.incident-index';
|
|
12
|
+
const COMPONENT_SPEC_SCENE_OVERRIDES = 'governance.spec-scene-overrides';
|
|
13
|
+
const COMPONENT_SPEC_SCENE_INDEX = 'governance.scene-index';
|
|
14
|
+
const COMPONENT_RELEASE_EVIDENCE_RUNS = 'release.evidence-runs-index';
|
|
15
|
+
const COMPONENT_RELEASE_GATE_HISTORY = 'release.gate-history-index';
|
|
10
16
|
const DEFAULT_STATE_EXPORT_PATH = '.sce/reports/state-migration/state-export.latest.json';
|
|
11
17
|
|
|
12
18
|
const COMPONENT_DEFINITIONS = Object.freeze([
|
|
@@ -21,6 +27,30 @@ const COMPONENT_DEFINITIONS = Object.freeze([
|
|
|
21
27
|
{
|
|
22
28
|
id: COMPONENT_SCENE_SESSION_INDEX,
|
|
23
29
|
source_path: '.sce/session-governance/scene-index.json'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: COMPONENT_ERRORBOOK_ENTRY_INDEX,
|
|
33
|
+
source_path: '.sce/errorbook/index.json'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: COMPONENT_ERRORBOOK_INCIDENT_INDEX,
|
|
37
|
+
source_path: '.sce/errorbook/staging/index.json'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: COMPONENT_SPEC_SCENE_OVERRIDES,
|
|
41
|
+
source_path: '.sce/spec-governance/spec-scene-overrides.json'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: COMPONENT_SPEC_SCENE_INDEX,
|
|
45
|
+
source_path: '.sce/spec-governance/scene-index.json'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: COMPONENT_RELEASE_EVIDENCE_RUNS,
|
|
49
|
+
source_path: '.sce/reports/release-evidence/handoff-runs.json'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: COMPONENT_RELEASE_GATE_HISTORY,
|
|
53
|
+
source_path: '.sce/reports/release-evidence/release-gate-history.json'
|
|
24
54
|
}
|
|
25
55
|
]);
|
|
26
56
|
|
|
@@ -159,6 +189,207 @@ function mapSceneSessionIndexPayload(payload = {}) {
|
|
|
159
189
|
return records;
|
|
160
190
|
}
|
|
161
191
|
|
|
192
|
+
function mapErrorbookEntryIndexPayload(payload = {}) {
|
|
193
|
+
if (!payload || typeof payload !== 'object' || !Array.isArray(payload.entries)) {
|
|
194
|
+
return [];
|
|
195
|
+
}
|
|
196
|
+
return payload.entries
|
|
197
|
+
.map((item) => ({
|
|
198
|
+
entry_id: normalizeString(item && (item.id || item.entry_id)),
|
|
199
|
+
fingerprint: normalizeString(item && item.fingerprint),
|
|
200
|
+
title: normalizeString(item && item.title),
|
|
201
|
+
status: normalizeString(item && item.status),
|
|
202
|
+
quality_score: normalizeInteger(item && item.quality_score, 0),
|
|
203
|
+
tags: Array.isArray(item && item.tags)
|
|
204
|
+
? item.tags.map((token) => normalizeString(token)).filter(Boolean)
|
|
205
|
+
: [],
|
|
206
|
+
ontology_tags: Array.isArray(item && item.ontology_tags)
|
|
207
|
+
? item.ontology_tags.map((token) => normalizeString(token)).filter(Boolean)
|
|
208
|
+
: [],
|
|
209
|
+
temporary_mitigation_active: item && item.temporary_mitigation_active === true,
|
|
210
|
+
temporary_mitigation_deadline_at: normalizeString(item && item.temporary_mitigation_deadline_at),
|
|
211
|
+
occurrences: normalizeInteger(item && item.occurrences, 0),
|
|
212
|
+
created_at: normalizeString(item && item.created_at),
|
|
213
|
+
updated_at: normalizeString(item && item.updated_at)
|
|
214
|
+
}))
|
|
215
|
+
.filter((item) => item.entry_id);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function mapErrorbookIncidentIndexPayload(payload = {}) {
|
|
219
|
+
if (!payload || typeof payload !== 'object' || !Array.isArray(payload.incidents)) {
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
return payload.incidents
|
|
223
|
+
.map((item) => ({
|
|
224
|
+
incident_id: normalizeString(item && (item.id || item.incident_id)),
|
|
225
|
+
fingerprint: normalizeString(item && item.fingerprint),
|
|
226
|
+
title: normalizeString(item && item.title),
|
|
227
|
+
symptom: normalizeString(item && item.symptom),
|
|
228
|
+
state: normalizeString(item && item.state),
|
|
229
|
+
attempt_count: normalizeInteger(item && item.attempt_count, 0),
|
|
230
|
+
created_at: normalizeString(item && item.created_at),
|
|
231
|
+
updated_at: normalizeString(item && item.updated_at),
|
|
232
|
+
last_attempt_at: normalizeString(item && item.last_attempt_at),
|
|
233
|
+
resolved_at: normalizeString(item && item.resolved_at),
|
|
234
|
+
linked_entry_id: normalizeString(item && item.linked_entry_id)
|
|
235
|
+
}))
|
|
236
|
+
.filter((item) => item.incident_id);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function mapSpecSceneOverridesPayload(payload = {}) {
|
|
240
|
+
if (!payload || typeof payload !== 'object' || !payload.mappings || typeof payload.mappings !== 'object') {
|
|
241
|
+
return [];
|
|
242
|
+
}
|
|
243
|
+
return Object.entries(payload.mappings)
|
|
244
|
+
.map(([specId, mapping]) => {
|
|
245
|
+
if (typeof mapping === 'string') {
|
|
246
|
+
return {
|
|
247
|
+
spec_id: normalizeString(specId),
|
|
248
|
+
scene_id: normalizeString(mapping),
|
|
249
|
+
source: 'override',
|
|
250
|
+
rule_id: '',
|
|
251
|
+
updated_at: normalizeString(payload && payload.updated_at)
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
spec_id: normalizeString(specId),
|
|
256
|
+
scene_id: normalizeString(mapping && mapping.scene_id),
|
|
257
|
+
source: normalizeString(mapping && mapping.source) || 'override',
|
|
258
|
+
rule_id: normalizeString(mapping && mapping.rule_id),
|
|
259
|
+
updated_at: normalizeString(mapping && mapping.updated_at) || normalizeString(payload && payload.updated_at)
|
|
260
|
+
};
|
|
261
|
+
})
|
|
262
|
+
.filter((item) => item.spec_id && item.scene_id);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function mapSpecSceneIndexPayload(payload = {}) {
|
|
266
|
+
if (!payload || typeof payload !== 'object' || !payload.scenes || typeof payload.scenes !== 'object') {
|
|
267
|
+
return [];
|
|
268
|
+
}
|
|
269
|
+
const generatedAt = normalizeString(payload.generated_at) || normalizeString(payload.updated_at);
|
|
270
|
+
const sceneFilter = normalizeString(payload.scene_filter);
|
|
271
|
+
return Object.entries(payload.scenes)
|
|
272
|
+
.map(([sceneId, scene]) => ({
|
|
273
|
+
scene_id: normalizeString(sceneId),
|
|
274
|
+
total_specs: normalizeInteger(scene && scene.total_specs, 0),
|
|
275
|
+
active_specs: normalizeInteger(scene && scene.active_specs, 0),
|
|
276
|
+
completed_specs: normalizeInteger(scene && scene.completed_specs, 0),
|
|
277
|
+
stale_specs: normalizeInteger(scene && scene.stale_specs, 0),
|
|
278
|
+
spec_ids: Array.isArray(scene && scene.spec_ids)
|
|
279
|
+
? scene.spec_ids.map((token) => normalizeString(token)).filter(Boolean)
|
|
280
|
+
: [],
|
|
281
|
+
active_spec_ids: Array.isArray(scene && scene.active_spec_ids)
|
|
282
|
+
? scene.active_spec_ids.map((token) => normalizeString(token)).filter(Boolean)
|
|
283
|
+
: [],
|
|
284
|
+
stale_spec_ids: Array.isArray(scene && scene.stale_spec_ids)
|
|
285
|
+
? scene.stale_spec_ids.map((token) => normalizeString(token)).filter(Boolean)
|
|
286
|
+
: [],
|
|
287
|
+
generated_at: generatedAt,
|
|
288
|
+
scene_filter: sceneFilter
|
|
289
|
+
}))
|
|
290
|
+
.filter((item) => item.scene_id);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function mapReleaseEvidenceRunsPayload(payload = {}) {
|
|
294
|
+
if (!payload || typeof payload !== 'object' || !Array.isArray(payload.sessions)) {
|
|
295
|
+
return [];
|
|
296
|
+
}
|
|
297
|
+
const sourceUpdatedAt = normalizeString(payload.updated_at) || normalizeString(payload.generated_at);
|
|
298
|
+
return payload.sessions
|
|
299
|
+
.map((session) => {
|
|
300
|
+
const gate = session && session.gate && typeof session.gate === 'object' ? session.gate : {};
|
|
301
|
+
const gateActual = gate && gate.actual && typeof gate.actual === 'object' ? gate.actual : {};
|
|
302
|
+
const coverage = session && session.capability_coverage && typeof session.capability_coverage === 'object'
|
|
303
|
+
? session.capability_coverage
|
|
304
|
+
: {};
|
|
305
|
+
const coverageSummary = coverage && coverage.summary && typeof coverage.summary === 'object'
|
|
306
|
+
? coverage.summary
|
|
307
|
+
: {};
|
|
308
|
+
const scenePackageBatch = session && session.scene_package_batch && typeof session.scene_package_batch === 'object'
|
|
309
|
+
? session.scene_package_batch
|
|
310
|
+
: {};
|
|
311
|
+
const scenePackageBatchSummary = scenePackageBatch && scenePackageBatch.summary && typeof scenePackageBatch.summary === 'object'
|
|
312
|
+
? scenePackageBatch.summary
|
|
313
|
+
: {};
|
|
314
|
+
const batchSummary = session && session.batch_summary && typeof session.batch_summary === 'object'
|
|
315
|
+
? session.batch_summary
|
|
316
|
+
: {};
|
|
317
|
+
const preflight = session && session.release_gate_preflight && typeof session.release_gate_preflight === 'object'
|
|
318
|
+
? session.release_gate_preflight
|
|
319
|
+
: {};
|
|
320
|
+
return {
|
|
321
|
+
session_id: normalizeString(session && session.session_id),
|
|
322
|
+
merged_at: normalizeString(session && session.merged_at) || normalizeString(session && session.generated_at),
|
|
323
|
+
status: normalizeString(session && session.status),
|
|
324
|
+
gate_passed: gate && gate.passed === true,
|
|
325
|
+
spec_success_rate_percent: Number.isFinite(Number(gateActual.spec_success_rate_percent))
|
|
326
|
+
? Number(gateActual.spec_success_rate_percent)
|
|
327
|
+
: null,
|
|
328
|
+
risk_level: normalizeString(gateActual.risk_level),
|
|
329
|
+
ontology_quality_score: Number.isFinite(Number(gateActual.ontology_quality_score))
|
|
330
|
+
? Number(gateActual.ontology_quality_score)
|
|
331
|
+
: null,
|
|
332
|
+
capability_coverage_percent: Number.isFinite(Number(coverageSummary.coverage_percent))
|
|
333
|
+
? Number(coverageSummary.coverage_percent)
|
|
334
|
+
: null,
|
|
335
|
+
capability_coverage_passed: coverageSummary.passed === true,
|
|
336
|
+
scene_package_batch_passed: scenePackageBatchSummary.batch_gate_passed === true,
|
|
337
|
+
scene_package_batch_failure_count: Number.isFinite(Number(scenePackageBatchSummary.batch_gate_failure_count))
|
|
338
|
+
? Number.parseInt(`${scenePackageBatchSummary.batch_gate_failure_count}`, 10)
|
|
339
|
+
: (
|
|
340
|
+
Number.isFinite(Number(scenePackageBatchSummary.failed))
|
|
341
|
+
? Number.parseInt(`${scenePackageBatchSummary.failed}`, 10)
|
|
342
|
+
: 0
|
|
343
|
+
),
|
|
344
|
+
failed_goals: Number.isFinite(Number(batchSummary.failed_goals))
|
|
345
|
+
? Number.parseInt(`${batchSummary.failed_goals}`, 10)
|
|
346
|
+
: 0,
|
|
347
|
+
release_gate_preflight_available: preflight && preflight.available === true,
|
|
348
|
+
release_gate_preflight_blocked: preflight && preflight.blocked === true,
|
|
349
|
+
source_updated_at: sourceUpdatedAt
|
|
350
|
+
};
|
|
351
|
+
})
|
|
352
|
+
.filter((item) => item.session_id);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function mapReleaseGateHistoryPayload(payload = {}) {
|
|
356
|
+
if (!payload || typeof payload !== 'object' || !Array.isArray(payload.entries)) {
|
|
357
|
+
return [];
|
|
358
|
+
}
|
|
359
|
+
const sourceUpdatedAt = normalizeString(payload.updated_at) || normalizeString(payload.generated_at);
|
|
360
|
+
return payload.entries
|
|
361
|
+
.map((entry) => ({
|
|
362
|
+
tag: normalizeString(entry && entry.tag),
|
|
363
|
+
evaluated_at: normalizeString(entry && entry.evaluated_at),
|
|
364
|
+
gate_passed: entry && entry.gate_passed === true,
|
|
365
|
+
enforce: entry && entry.enforce === true,
|
|
366
|
+
risk_level: normalizeString(entry && entry.risk_level),
|
|
367
|
+
spec_success_rate_percent: Number.isFinite(Number(entry && entry.spec_success_rate_percent))
|
|
368
|
+
? Number(entry.spec_success_rate_percent)
|
|
369
|
+
: null,
|
|
370
|
+
scene_package_batch_passed: entry && entry.scene_package_batch_passed === true,
|
|
371
|
+
scene_package_batch_failure_count: Number.isFinite(Number(entry && entry.scene_package_batch_failure_count))
|
|
372
|
+
? Number.parseInt(`${entry.scene_package_batch_failure_count}`, 10)
|
|
373
|
+
: 0,
|
|
374
|
+
capability_expected_unknown_count: Number.isFinite(Number(entry && entry.capability_expected_unknown_count))
|
|
375
|
+
? Number.parseInt(`${entry.capability_expected_unknown_count}`, 10)
|
|
376
|
+
: 0,
|
|
377
|
+
capability_provided_unknown_count: Number.isFinite(Number(entry && entry.capability_provided_unknown_count))
|
|
378
|
+
? Number.parseInt(`${entry.capability_provided_unknown_count}`, 10)
|
|
379
|
+
: 0,
|
|
380
|
+
release_gate_preflight_available: entry && entry.release_gate_preflight_available === true,
|
|
381
|
+
release_gate_preflight_blocked: entry && entry.release_gate_preflight_blocked === true,
|
|
382
|
+
require_release_gate_preflight: entry && entry.require_release_gate_preflight === true,
|
|
383
|
+
drift_alert_count: Number.isFinite(Number(entry && entry.drift_alert_count))
|
|
384
|
+
? Number.parseInt(`${entry.drift_alert_count}`, 10)
|
|
385
|
+
: 0,
|
|
386
|
+
drift_blocked: entry && entry.drift_blocked === true,
|
|
387
|
+
weekly_ops_blocked: entry && entry.weekly_ops_blocked === true,
|
|
388
|
+
source_updated_at: sourceUpdatedAt
|
|
389
|
+
}))
|
|
390
|
+
.filter((item) => item.tag);
|
|
391
|
+
}
|
|
392
|
+
|
|
162
393
|
async function readJsonSource(absolutePath, fileSystem = fs) {
|
|
163
394
|
if (!await fileSystem.pathExists(absolutePath)) {
|
|
164
395
|
return {
|
|
@@ -196,6 +427,18 @@ async function readComponentSnapshot(component = {}, projectPath = process.cwd()
|
|
|
196
427
|
records = mapTimelineIndexPayload(source.payload);
|
|
197
428
|
} else if (component.id === COMPONENT_SCENE_SESSION_INDEX) {
|
|
198
429
|
records = mapSceneSessionIndexPayload(source.payload);
|
|
430
|
+
} else if (component.id === COMPONENT_ERRORBOOK_ENTRY_INDEX) {
|
|
431
|
+
records = mapErrorbookEntryIndexPayload(source.payload);
|
|
432
|
+
} else if (component.id === COMPONENT_ERRORBOOK_INCIDENT_INDEX) {
|
|
433
|
+
records = mapErrorbookIncidentIndexPayload(source.payload);
|
|
434
|
+
} else if (component.id === COMPONENT_SPEC_SCENE_OVERRIDES) {
|
|
435
|
+
records = mapSpecSceneOverridesPayload(source.payload);
|
|
436
|
+
} else if (component.id === COMPONENT_SPEC_SCENE_INDEX) {
|
|
437
|
+
records = mapSpecSceneIndexPayload(source.payload);
|
|
438
|
+
} else if (component.id === COMPONENT_RELEASE_EVIDENCE_RUNS) {
|
|
439
|
+
records = mapReleaseEvidenceRunsPayload(source.payload);
|
|
440
|
+
} else if (component.id === COMPONENT_RELEASE_GATE_HISTORY) {
|
|
441
|
+
records = mapReleaseGateHistoryPayload(source.payload);
|
|
199
442
|
}
|
|
200
443
|
}
|
|
201
444
|
|
|
@@ -285,6 +528,36 @@ async function writeComponentToStateStore(componentSnapshot = {}, stateStore, co
|
|
|
285
528
|
source: componentId
|
|
286
529
|
});
|
|
287
530
|
}
|
|
531
|
+
if (componentId === COMPONENT_ERRORBOOK_ENTRY_INDEX) {
|
|
532
|
+
return stateStore.upsertErrorbookEntryIndexRecords(componentSnapshot.records, {
|
|
533
|
+
source: componentId
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
if (componentId === COMPONENT_ERRORBOOK_INCIDENT_INDEX) {
|
|
537
|
+
return stateStore.upsertErrorbookIncidentIndexRecords(componentSnapshot.records, {
|
|
538
|
+
source: componentId
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
if (componentId === COMPONENT_SPEC_SCENE_OVERRIDES) {
|
|
542
|
+
return stateStore.upsertGovernanceSpecSceneOverrideRecords(componentSnapshot.records, {
|
|
543
|
+
source: componentId
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
if (componentId === COMPONENT_SPEC_SCENE_INDEX) {
|
|
547
|
+
return stateStore.upsertGovernanceSceneIndexRecords(componentSnapshot.records, {
|
|
548
|
+
source: componentId
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
if (componentId === COMPONENT_RELEASE_EVIDENCE_RUNS) {
|
|
552
|
+
return stateStore.upsertReleaseEvidenceRunRecords(componentSnapshot.records, {
|
|
553
|
+
source: componentId
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
if (componentId === COMPONENT_RELEASE_GATE_HISTORY) {
|
|
557
|
+
return stateStore.upsertReleaseGateHistoryRecords(componentSnapshot.records, {
|
|
558
|
+
source: componentId
|
|
559
|
+
});
|
|
560
|
+
}
|
|
288
561
|
return null;
|
|
289
562
|
}
|
|
290
563
|
|
|
@@ -404,17 +677,40 @@ async function runStateDoctor(options = {}, dependencies = {}) {
|
|
|
404
677
|
const stateStore = dependencies.stateStore || getSceStateStore(projectPath, { fileSystem, env });
|
|
405
678
|
const plan = await buildStateMigrationPlan({}, { projectPath, fileSystem, env, stateStore });
|
|
406
679
|
|
|
407
|
-
const [
|
|
680
|
+
const [
|
|
681
|
+
agentRows,
|
|
682
|
+
timelineRows,
|
|
683
|
+
sessionRows,
|
|
684
|
+
errorbookEntryRows,
|
|
685
|
+
errorbookIncidentRows,
|
|
686
|
+
governanceOverrideRows,
|
|
687
|
+
governanceSceneRows,
|
|
688
|
+
releaseEvidenceRows,
|
|
689
|
+
releaseGateHistoryRows,
|
|
690
|
+
migrations
|
|
691
|
+
] = await Promise.all([
|
|
408
692
|
stateStore.listAgentRuntimeRecords({ limit: 0 }),
|
|
409
693
|
stateStore.listTimelineSnapshotIndex({ limit: 0 }),
|
|
410
694
|
stateStore.listSceneSessionCycles({ limit: 0 }),
|
|
695
|
+
stateStore.listErrorbookEntryIndexRecords({ limit: 0 }),
|
|
696
|
+
stateStore.listErrorbookIncidentIndexRecords({ limit: 0 }),
|
|
697
|
+
stateStore.listGovernanceSpecSceneOverrideRecords({ limit: 0 }),
|
|
698
|
+
stateStore.listGovernanceSceneIndexRecords({ limit: 0 }),
|
|
699
|
+
stateStore.listReleaseEvidenceRunRecords({ limit: 0 }),
|
|
700
|
+
stateStore.listReleaseGateHistoryRecords({ limit: 0 }),
|
|
411
701
|
stateStore.listStateMigrations({ limit: 20 })
|
|
412
702
|
]);
|
|
413
703
|
|
|
414
704
|
const targetCounts = new Map([
|
|
415
705
|
[COMPONENT_AGENT_REGISTRY, Array.isArray(agentRows) ? agentRows.length : 0],
|
|
416
706
|
[COMPONENT_TIMELINE_INDEX, Array.isArray(timelineRows) ? timelineRows.length : 0],
|
|
417
|
-
[COMPONENT_SCENE_SESSION_INDEX, Array.isArray(sessionRows) ? sessionRows.length : 0]
|
|
707
|
+
[COMPONENT_SCENE_SESSION_INDEX, Array.isArray(sessionRows) ? sessionRows.length : 0],
|
|
708
|
+
[COMPONENT_ERRORBOOK_ENTRY_INDEX, Array.isArray(errorbookEntryRows) ? errorbookEntryRows.length : 0],
|
|
709
|
+
[COMPONENT_ERRORBOOK_INCIDENT_INDEX, Array.isArray(errorbookIncidentRows) ? errorbookIncidentRows.length : 0],
|
|
710
|
+
[COMPONENT_SPEC_SCENE_OVERRIDES, Array.isArray(governanceOverrideRows) ? governanceOverrideRows.length : 0],
|
|
711
|
+
[COMPONENT_SPEC_SCENE_INDEX, Array.isArray(governanceSceneRows) ? governanceSceneRows.length : 0],
|
|
712
|
+
[COMPONENT_RELEASE_EVIDENCE_RUNS, Array.isArray(releaseEvidenceRows) ? releaseEvidenceRows.length : 0],
|
|
713
|
+
[COMPONENT_RELEASE_GATE_HISTORY, Array.isArray(releaseGateHistoryRows) ? releaseGateHistoryRows.length : 0]
|
|
418
714
|
]);
|
|
419
715
|
|
|
420
716
|
const checks = plan.components.map((component) => {
|
|
@@ -614,10 +910,27 @@ async function runStateExport(options = {}, dependencies = {}) {
|
|
|
614
910
|
: path.join(projectPath, outPathRaw);
|
|
615
911
|
const stateStore = dependencies.stateStore || getSceStateStore(projectPath, { fileSystem, env });
|
|
616
912
|
|
|
617
|
-
const [
|
|
913
|
+
const [
|
|
914
|
+
agentRows,
|
|
915
|
+
timelineRows,
|
|
916
|
+
sessionRows,
|
|
917
|
+
errorbookEntryRows,
|
|
918
|
+
errorbookIncidentRows,
|
|
919
|
+
governanceOverrideRows,
|
|
920
|
+
governanceSceneRows,
|
|
921
|
+
releaseEvidenceRows,
|
|
922
|
+
releaseGateHistoryRows,
|
|
923
|
+
migrations
|
|
924
|
+
] = await Promise.all([
|
|
618
925
|
stateStore.listAgentRuntimeRecords({ limit: 0 }),
|
|
619
926
|
stateStore.listTimelineSnapshotIndex({ limit: 0 }),
|
|
620
927
|
stateStore.listSceneSessionCycles({ limit: 0 }),
|
|
928
|
+
stateStore.listErrorbookEntryIndexRecords({ limit: 0 }),
|
|
929
|
+
stateStore.listErrorbookIncidentIndexRecords({ limit: 0 }),
|
|
930
|
+
stateStore.listGovernanceSpecSceneOverrideRecords({ limit: 0 }),
|
|
931
|
+
stateStore.listGovernanceSceneIndexRecords({ limit: 0 }),
|
|
932
|
+
stateStore.listReleaseEvidenceRunRecords({ limit: 0 }),
|
|
933
|
+
stateStore.listReleaseGateHistoryRecords({ limit: 0 }),
|
|
621
934
|
stateStore.listStateMigrations({ limit: 0 })
|
|
622
935
|
]);
|
|
623
936
|
|
|
@@ -630,12 +943,24 @@ async function runStateExport(options = {}, dependencies = {}) {
|
|
|
630
943
|
agent_runtime_registry: Array.isArray(agentRows) ? agentRows : [],
|
|
631
944
|
timeline_snapshot_registry: Array.isArray(timelineRows) ? timelineRows : [],
|
|
632
945
|
scene_session_cycle_registry: Array.isArray(sessionRows) ? sessionRows : [],
|
|
946
|
+
errorbook_entry_index_registry: Array.isArray(errorbookEntryRows) ? errorbookEntryRows : [],
|
|
947
|
+
errorbook_incident_index_registry: Array.isArray(errorbookIncidentRows) ? errorbookIncidentRows : [],
|
|
948
|
+
governance_spec_scene_override_registry: Array.isArray(governanceOverrideRows) ? governanceOverrideRows : [],
|
|
949
|
+
governance_scene_index_registry: Array.isArray(governanceSceneRows) ? governanceSceneRows : [],
|
|
950
|
+
release_evidence_run_registry: Array.isArray(releaseEvidenceRows) ? releaseEvidenceRows : [],
|
|
951
|
+
release_gate_history_registry: Array.isArray(releaseGateHistoryRows) ? releaseGateHistoryRows : [],
|
|
633
952
|
state_migration_registry: Array.isArray(migrations) ? migrations : []
|
|
634
953
|
},
|
|
635
954
|
summary: {
|
|
636
955
|
agent_runtime_registry: Array.isArray(agentRows) ? agentRows.length : 0,
|
|
637
956
|
timeline_snapshot_registry: Array.isArray(timelineRows) ? timelineRows.length : 0,
|
|
638
957
|
scene_session_cycle_registry: Array.isArray(sessionRows) ? sessionRows.length : 0,
|
|
958
|
+
errorbook_entry_index_registry: Array.isArray(errorbookEntryRows) ? errorbookEntryRows.length : 0,
|
|
959
|
+
errorbook_incident_index_registry: Array.isArray(errorbookIncidentRows) ? errorbookIncidentRows.length : 0,
|
|
960
|
+
governance_spec_scene_override_registry: Array.isArray(governanceOverrideRows) ? governanceOverrideRows.length : 0,
|
|
961
|
+
governance_scene_index_registry: Array.isArray(governanceSceneRows) ? governanceSceneRows.length : 0,
|
|
962
|
+
release_evidence_run_registry: Array.isArray(releaseEvidenceRows) ? releaseEvidenceRows.length : 0,
|
|
963
|
+
release_gate_history_registry: Array.isArray(releaseGateHistoryRows) ? releaseGateHistoryRows.length : 0,
|
|
639
964
|
state_migration_registry: Array.isArray(migrations) ? migrations.length : 0
|
|
640
965
|
},
|
|
641
966
|
out_file: path.relative(projectPath, outPath).replace(/\\/g, '/')
|
|
@@ -650,6 +975,12 @@ module.exports = {
|
|
|
650
975
|
COMPONENT_AGENT_REGISTRY,
|
|
651
976
|
COMPONENT_TIMELINE_INDEX,
|
|
652
977
|
COMPONENT_SCENE_SESSION_INDEX,
|
|
978
|
+
COMPONENT_ERRORBOOK_ENTRY_INDEX,
|
|
979
|
+
COMPONENT_ERRORBOOK_INCIDENT_INDEX,
|
|
980
|
+
COMPONENT_SPEC_SCENE_OVERRIDES,
|
|
981
|
+
COMPONENT_SPEC_SCENE_INDEX,
|
|
982
|
+
COMPONENT_RELEASE_EVIDENCE_RUNS,
|
|
983
|
+
COMPONENT_RELEASE_GATE_HISTORY,
|
|
653
984
|
COMPONENT_DEFINITIONS,
|
|
654
985
|
DEFAULT_STATE_EXPORT_PATH,
|
|
655
986
|
buildStateMigrationPlan,
|
package/package.json
CHANGED