@exellix/exellix-runtime 3.5.1
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/README.md +422 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.d.ts +4 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.js +311 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.js.map +1 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.d.ts +64 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.js +226 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.js.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.d.ts +145 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.js +477 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.js.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.d.ts +2 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.js +34 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.js.map +1 -0
- package/dist/cli/argv.d.ts +5 -0
- package/dist/cli/argv.d.ts.map +1 -0
- package/dist/cli/argv.js +32 -0
- package/dist/cli/argv.js.map +1 -0
- package/dist/cli/commands/health.d.ts +2 -0
- package/dist/cli/commands/health.d.ts.map +1 -0
- package/dist/cli/commands/health.js +23 -0
- package/dist/cli/commands/health.js.map +1 -0
- package/dist/cli/commands/matrix-link.d.ts +2 -0
- package/dist/cli/commands/matrix-link.d.ts.map +1 -0
- package/dist/cli/commands/matrix-link.js +56 -0
- package/dist/cli/commands/matrix-link.js.map +1 -0
- package/dist/cli/commands/matrix-read.d.ts +2 -0
- package/dist/cli/commands/matrix-read.d.ts.map +1 -0
- package/dist/cli/commands/matrix-read.js +73 -0
- package/dist/cli/commands/matrix-read.js.map +1 -0
- package/dist/cli/env.d.ts +6 -0
- package/dist/cli/env.d.ts.map +1 -0
- package/dist/cli/env.js +39 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/exellix-runtime-cli.d.ts +3 -0
- package/dist/cli/exellix-runtime-cli.d.ts.map +1 -0
- package/dist/cli/exellix-runtime-cli.js +55 -0
- package/dist/cli/exellix-runtime-cli.js.map +1 -0
- package/dist/cli/help.d.ts +19 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +94 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/client-toolbox/bundle.d.ts +17 -0
- package/dist/client-toolbox/bundle.d.ts.map +1 -0
- package/dist/client-toolbox/bundle.js +17 -0
- package/dist/client-toolbox/bundle.js.map +1 -0
- package/dist/client-toolbox/client-toolbox.spec.d.ts +2 -0
- package/dist/client-toolbox/client-toolbox.spec.d.ts.map +1 -0
- package/dist/client-toolbox/client-toolbox.spec.js +145 -0
- package/dist/client-toolbox/client-toolbox.spec.js.map +1 -0
- package/dist/client-toolbox/index.d.ts +4 -0
- package/dist/client-toolbox/index.d.ts.map +1 -0
- package/dist/client-toolbox/index.js +4 -0
- package/dist/client-toolbox/index.js.map +1 -0
- package/dist/client-toolbox/matrix-config.d.ts +67 -0
- package/dist/client-toolbox/matrix-config.d.ts.map +1 -0
- package/dist/client-toolbox/matrix-config.js +140 -0
- package/dist/client-toolbox/matrix-config.js.map +1 -0
- package/dist/client-toolbox/matrix-materialize.d.ts +56 -0
- package/dist/client-toolbox/matrix-materialize.d.ts.map +1 -0
- package/dist/client-toolbox/matrix-materialize.js +130 -0
- package/dist/client-toolbox/matrix-materialize.js.map +1 -0
- package/dist/dev/matrix-read-dashboard-smoke.d.ts +2 -0
- package/dist/dev/matrix-read-dashboard-smoke.d.ts.map +1 -0
- package/dist/dev/matrix-read-dashboard-smoke.js +12 -0
- package/dist/dev/matrix-read-dashboard-smoke.js.map +1 -0
- package/dist/dev/runtime-real-dev-server.d.ts +2 -0
- package/dist/dev/runtime-real-dev-server.d.ts.map +1 -0
- package/dist/dev/runtime-real-dev-server.js +90 -0
- package/dist/dev/runtime-real-dev-server.js.map +1 -0
- package/dist/execution-matrix/catalox-loader.d.ts +55 -0
- package/dist/execution-matrix/catalox-loader.d.ts.map +1 -0
- package/dist/execution-matrix/catalox-loader.js +199 -0
- package/dist/execution-matrix/catalox-loader.js.map +1 -0
- package/dist/execution-matrix/catalox-matrix-host.d.ts +20 -0
- package/dist/execution-matrix/catalox-matrix-host.d.ts.map +1 -0
- package/dist/execution-matrix/catalox-matrix-host.js +19 -0
- package/dist/execution-matrix/catalox-matrix-host.js.map +1 -0
- package/dist/execution-matrix/collections.d.ts +16 -0
- package/dist/execution-matrix/collections.d.ts.map +1 -0
- package/dist/execution-matrix/collections.js +75 -0
- package/dist/execution-matrix/collections.js.map +1 -0
- package/dist/execution-matrix/config-store.d.ts +104 -0
- package/dist/execution-matrix/config-store.d.ts.map +1 -0
- package/dist/execution-matrix/config-store.js +273 -0
- package/dist/execution-matrix/config-store.js.map +1 -0
- package/dist/execution-matrix/constants.d.ts +19 -0
- package/dist/execution-matrix/constants.d.ts.map +1 -0
- package/dist/execution-matrix/constants.js +19 -0
- package/dist/execution-matrix/constants.js.map +1 -0
- package/dist/execution-matrix/contracts.d.ts +568 -0
- package/dist/execution-matrix/contracts.d.ts.map +1 -0
- package/dist/execution-matrix/contracts.js +44 -0
- package/dist/execution-matrix/contracts.js.map +1 -0
- package/dist/execution-matrix/data-source.d.ts +43 -0
- package/dist/execution-matrix/data-source.d.ts.map +1 -0
- package/dist/execution-matrix/data-source.js +307 -0
- package/dist/execution-matrix/data-source.js.map +1 -0
- package/dist/execution-matrix/eligibility.d.ts +48 -0
- package/dist/execution-matrix/eligibility.d.ts.map +1 -0
- package/dist/execution-matrix/eligibility.js +89 -0
- package/dist/execution-matrix/eligibility.js.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.d.ts +20 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.js +18 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.js.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.js +23 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.js.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix.live.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.spec.js +152 -0
- package/dist/execution-matrix/execution-matrix.live.spec.js.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.js +346 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.js.map +1 -0
- package/dist/execution-matrix/execution-matrix.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix.spec.js +1786 -0
- package/dist/execution-matrix/execution-matrix.spec.js.map +1 -0
- package/dist/execution-matrix/execution-mode.d.ts +34 -0
- package/dist/execution-matrix/execution-mode.d.ts.map +1 -0
- package/dist/execution-matrix/execution-mode.js +72 -0
- package/dist/execution-matrix/execution-mode.js.map +1 -0
- package/dist/execution-matrix/factory.d.ts +72 -0
- package/dist/execution-matrix/factory.d.ts.map +1 -0
- package/dist/execution-matrix/factory.js +77 -0
- package/dist/execution-matrix/factory.js.map +1 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.d.ts +2 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.d.ts.map +1 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.js +48 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.js.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.d.ts +130 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.d.ts.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.js +146 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.js.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.d.ts +2 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.d.ts.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.js +66 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.js.map +1 -0
- package/dist/execution-matrix/graph-operational-aggregates.d.ts +47 -0
- package/dist/execution-matrix/graph-operational-aggregates.d.ts.map +1 -0
- package/dist/execution-matrix/graph-operational-aggregates.js +137 -0
- package/dist/execution-matrix/graph-operational-aggregates.js.map +1 -0
- package/dist/execution-matrix/graph-operational-lifecycle.d.ts +43 -0
- package/dist/execution-matrix/graph-operational-lifecycle.d.ts.map +1 -0
- package/dist/execution-matrix/graph-operational-lifecycle.js +88 -0
- package/dist/execution-matrix/graph-operational-lifecycle.js.map +1 -0
- package/dist/execution-matrix/graph-operational.spec.d.ts +2 -0
- package/dist/execution-matrix/graph-operational.spec.d.ts.map +1 -0
- package/dist/execution-matrix/graph-operational.spec.js +203 -0
- package/dist/execution-matrix/graph-operational.spec.js.map +1 -0
- package/dist/execution-matrix/index.d.ts +73 -0
- package/dist/execution-matrix/index.d.ts.map +1 -0
- package/dist/execution-matrix/index.js +57 -0
- package/dist/execution-matrix/index.js.map +1 -0
- package/dist/execution-matrix/live-tier-open.d.ts +6 -0
- package/dist/execution-matrix/live-tier-open.d.ts.map +1 -0
- package/dist/execution-matrix/live-tier-open.js +6 -0
- package/dist/execution-matrix/live-tier-open.js.map +1 -0
- package/dist/execution-matrix/materializer.d.ts +99 -0
- package/dist/execution-matrix/materializer.d.ts.map +1 -0
- package/dist/execution-matrix/materializer.js +210 -0
- package/dist/execution-matrix/materializer.js.map +1 -0
- package/dist/execution-matrix/matrix-activix.d.ts +24 -0
- package/dist/execution-matrix/matrix-activix.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-activix.js +34 -0
- package/dist/execution-matrix/matrix-activix.js.map +1 -0
- package/dist/execution-matrix/matrix-data-tier.d.ts +55 -0
- package/dist/execution-matrix/matrix-data-tier.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-data-tier.js +74 -0
- package/dist/execution-matrix/matrix-data-tier.js.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.d.ts +43 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.js +62 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.js.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.d.ts +2 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.js +60 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.js.map +1 -0
- package/dist/execution-matrix/matrix-logxer.d.ts +15 -0
- package/dist/execution-matrix/matrix-logxer.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-logxer.js +65 -0
- package/dist/execution-matrix/matrix-logxer.js.map +1 -0
- package/dist/execution-matrix/matrix-read-tier.d.ts +41 -0
- package/dist/execution-matrix/matrix-read-tier.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-read-tier.js +41 -0
- package/dist/execution-matrix/matrix-read-tier.js.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.d.ts +25 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.js +32 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.js.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.d.ts +2 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.js +83 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.js.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.d.ts +73 -0
- package/dist/execution-matrix/memorix-inference-persister.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.js +126 -0
- package/dist/execution-matrix/memorix-inference-persister.js.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.d.ts +2 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.js +117 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.js.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.d.ts +71 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.js +91 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.js.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.d.ts +2 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.js +151 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.js.map +1 -0
- package/dist/execution-matrix/memorix-runtime-tier.d.ts +153 -0
- package/dist/execution-matrix/memorix-runtime-tier.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-runtime-tier.js +185 -0
- package/dist/execution-matrix/memorix-runtime-tier.js.map +1 -0
- package/dist/execution-matrix/memorix-tier-statistics.d.ts +103 -0
- package/dist/execution-matrix/memorix-tier-statistics.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-tier-statistics.js +164 -0
- package/dist/execution-matrix/memorix-tier-statistics.js.map +1 -0
- package/dist/execution-matrix/memory-store.d.ts +20 -0
- package/dist/execution-matrix/memory-store.d.ts.map +1 -0
- package/dist/execution-matrix/memory-store.js +185 -0
- package/dist/execution-matrix/memory-store.js.map +1 -0
- package/dist/execution-matrix/navigator.d.ts +97 -0
- package/dist/execution-matrix/navigator.d.ts.map +1 -0
- package/dist/execution-matrix/navigator.js +119 -0
- package/dist/execution-matrix/navigator.js.map +1 -0
- package/dist/execution-matrix/orchestrator.d.ts +204 -0
- package/dist/execution-matrix/orchestrator.d.ts.map +1 -0
- package/dist/execution-matrix/orchestrator.js +656 -0
- package/dist/execution-matrix/orchestrator.js.map +1 -0
- package/dist/execution-matrix/records-eligibility.d.ts +34 -0
- package/dist/execution-matrix/records-eligibility.d.ts.map +1 -0
- package/dist/execution-matrix/records-eligibility.js +110 -0
- package/dist/execution-matrix/records-eligibility.js.map +1 -0
- package/dist/execution-matrix/records-eligibility.spec.d.ts +2 -0
- package/dist/execution-matrix/records-eligibility.spec.d.ts.map +1 -0
- package/dist/execution-matrix/records-eligibility.spec.js +154 -0
- package/dist/execution-matrix/records-eligibility.spec.js.map +1 -0
- package/dist/execution-matrix/run-loop.d.ts +140 -0
- package/dist/execution-matrix/run-loop.d.ts.map +1 -0
- package/dist/execution-matrix/run-loop.js +350 -0
- package/dist/execution-matrix/run-loop.js.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.d.ts +128 -0
- package/dist/execution-matrix/runtime-connectivity-health.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.js +253 -0
- package/dist/execution-matrix/runtime-connectivity-health.js.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.d.ts +2 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.js +23 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.js.map +1 -0
- package/dist/execution-matrix/runtime-objects.d.ts +16 -0
- package/dist/execution-matrix/runtime-objects.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-objects.js +20 -0
- package/dist/execution-matrix/runtime-objects.js.map +1 -0
- package/dist/execution-matrix/runtime-store.d.ts +114 -0
- package/dist/execution-matrix/runtime-store.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-store.js +506 -0
- package/dist/execution-matrix/runtime-store.js.map +1 -0
- package/dist/execution-matrix/snapshot-runner.d.ts +50 -0
- package/dist/execution-matrix/snapshot-runner.d.ts.map +1 -0
- package/dist/execution-matrix/snapshot-runner.js +111 -0
- package/dist/execution-matrix/snapshot-runner.js.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.d.ts +31 -0
- package/dist/execution-matrix/source-resolver-factories.d.ts.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.js +71 -0
- package/dist/execution-matrix/source-resolver-factories.js.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.spec.d.ts +2 -0
- package/dist/execution-matrix/source-resolver-factories.spec.d.ts.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.spec.js +127 -0
- package/dist/execution-matrix/source-resolver-factories.spec.js.map +1 -0
- package/dist/execution-matrix/source-resolver.d.ts +31 -0
- package/dist/execution-matrix/source-resolver.d.ts.map +1 -0
- package/dist/execution-matrix/source-resolver.js +26 -0
- package/dist/execution-matrix/source-resolver.js.map +1 -0
- package/dist/execution-matrix/status.d.ts +7 -0
- package/dist/execution-matrix/status.d.ts.map +1 -0
- package/dist/execution-matrix/status.js +33 -0
- package/dist/execution-matrix/status.js.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.d.ts +69 -0
- package/dist/execution-matrix/xmemory-entity-collections.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.js +120 -0
- package/dist/execution-matrix/xmemory-entity-collections.js.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.d.ts +2 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.js +112 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.js.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.d.ts +172 -0
- package/dist/execution-matrix/xmemory-op-tier.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.js +339 -0
- package/dist/execution-matrix/xmemory-op-tier.js.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.d.ts +2 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.js +198 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.js.map +1 -0
- package/dist/execution-matrix/xronox-matrix-factory.d.ts +38 -0
- package/dist/execution-matrix/xronox-matrix-factory.d.ts.map +1 -0
- package/dist/execution-matrix/xronox-matrix-factory.js +77 -0
- package/dist/execution-matrix/xronox-matrix-factory.js.map +1 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.d.ts +15 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.d.ts.map +1 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.js +41 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.js.map +1 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.d.ts +16 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.d.ts.map +1 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.js +16 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.js.map +1 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.d.ts +26 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.d.ts.map +1 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.js +82 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { RUNTIME_ROW_INPUT_SOURCE_ID_KEY } from './contracts.js';
|
|
2
|
+
import { rollupSourceExecutionStatuses } from './records-eligibility.js';
|
|
3
|
+
import { assertExecutionMatrixStatus, normalizeExecutionMatrixStatus } from './status.js';
|
|
4
|
+
function isoNow() {
|
|
5
|
+
return new Date().toISOString();
|
|
6
|
+
}
|
|
7
|
+
function emptyCounts() {
|
|
8
|
+
return {
|
|
9
|
+
'not-started': 0,
|
|
10
|
+
'in-progress': 0,
|
|
11
|
+
completed: 0,
|
|
12
|
+
failed: 0,
|
|
13
|
+
skipped: 0,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function rowMatchesExtraFilter(row, filter) {
|
|
17
|
+
if (!filter || Object.keys(filter).length === 0)
|
|
18
|
+
return true;
|
|
19
|
+
for (const [path, expected] of Object.entries(filter)) {
|
|
20
|
+
const parts = path.split('.').filter(Boolean);
|
|
21
|
+
let cur = row;
|
|
22
|
+
for (const p of parts) {
|
|
23
|
+
if (cur == null || typeof cur !== 'object')
|
|
24
|
+
return false;
|
|
25
|
+
cur = cur[p];
|
|
26
|
+
}
|
|
27
|
+
if (cur !== expected)
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* When **every** scope specifies non-empty `graphIds`, rollups use their union; otherwise all graphs
|
|
34
|
+
* on matched rows are included.
|
|
35
|
+
*/
|
|
36
|
+
function rollupGraphIdsUnion(scopes) {
|
|
37
|
+
if (scopes.length === 0)
|
|
38
|
+
return undefined;
|
|
39
|
+
const allHave = scopes.every((s) => Array.isArray(s.graphIds) && s.graphIds.length > 0);
|
|
40
|
+
if (!allHave)
|
|
41
|
+
return undefined;
|
|
42
|
+
return [...new Set(scopes.flatMap((s) => s.graphIds))];
|
|
43
|
+
}
|
|
44
|
+
/** xronox / memory filter for matrix rows scoped by catalog and optional per-graph execution slot. */
|
|
45
|
+
export function buildMatrixRowReadFilter(matrixCatalogId, matrixRunId, graphId, status, extra) {
|
|
46
|
+
const base = { matrixCatalogId, ...(matrixRunId ? { matrixRunId } : {}) };
|
|
47
|
+
if (graphId && status) {
|
|
48
|
+
return {
|
|
49
|
+
...base,
|
|
50
|
+
execution: { $elemMatch: { graphId, status } },
|
|
51
|
+
...extra,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (graphId) {
|
|
55
|
+
return { ...base, execution: { $elemMatch: { graphId } }, ...extra };
|
|
56
|
+
}
|
|
57
|
+
return { ...base, ...extra };
|
|
58
|
+
}
|
|
59
|
+
/** xronox filter for snapshot reads (shared by {@link ExecutionMatrixRuntime.listSnapshots} / {@link ExecutionMatrixRuntime.countSnapshots}). */
|
|
60
|
+
export function buildSnapshotsReadFilter(opts) {
|
|
61
|
+
const filter = {};
|
|
62
|
+
if (opts.matrixCatalogId !== undefined)
|
|
63
|
+
filter.matrixCatalogId = opts.matrixCatalogId;
|
|
64
|
+
if (opts.matrixRunId !== undefined)
|
|
65
|
+
filter.matrixRunId = opts.matrixRunId;
|
|
66
|
+
if ('entityType' in opts && opts.entityType !== undefined)
|
|
67
|
+
filter.entityType = opts.entityType;
|
|
68
|
+
const xf = 'extraFilter' in opts ? opts.extraFilter : undefined;
|
|
69
|
+
if (xf && Object.keys(xf).length > 0) {
|
|
70
|
+
Object.assign(filter, xf);
|
|
71
|
+
}
|
|
72
|
+
return filter;
|
|
73
|
+
}
|
|
74
|
+
/** xronox filter for failure reads (shared by count/list). */
|
|
75
|
+
export function buildFailureRecordsReadFilter(opts) {
|
|
76
|
+
const filter = { matrixCatalogId: opts.matrixCatalogId };
|
|
77
|
+
if (opts.matrixRunId !== undefined)
|
|
78
|
+
filter.matrixRunId = opts.matrixRunId;
|
|
79
|
+
if (opts.graphId !== undefined)
|
|
80
|
+
filter.graphId = opts.graphId;
|
|
81
|
+
if (opts.matrixRowId !== undefined)
|
|
82
|
+
filter.matrixRowId = opts.matrixRowId;
|
|
83
|
+
if (opts.createdAtMin !== undefined || opts.createdAtMax !== undefined) {
|
|
84
|
+
const bounds = {};
|
|
85
|
+
if (opts.createdAtMin !== undefined)
|
|
86
|
+
bounds.$gte = opts.createdAtMin;
|
|
87
|
+
if (opts.createdAtMax !== undefined)
|
|
88
|
+
bounds.$lte = opts.createdAtMax;
|
|
89
|
+
filter.createdAt = bounds;
|
|
90
|
+
}
|
|
91
|
+
return filter;
|
|
92
|
+
}
|
|
93
|
+
function buildLastAttempt(status, endedAt, meta) {
|
|
94
|
+
const out = { status, endedAt };
|
|
95
|
+
if (meta?.modelProfile)
|
|
96
|
+
out.modelProfile = meta.modelProfile;
|
|
97
|
+
if (meta?.jobId)
|
|
98
|
+
out.jobId = meta.jobId;
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Runtime persistence for execution matrix rows, failure side-channel, and snapshots.
|
|
103
|
+
* **All reads and writes go through {@link @x12i/xronox-store} collections** — this package does not
|
|
104
|
+
* accept or open a native Mongo `Db` handle. Claims use read–modify–write on the rows collection;
|
|
105
|
+
* set `serializeClaims: false` only when a single worker owns claims (unsafe under concurrent claimants).
|
|
106
|
+
*
|
|
107
|
+
* Snapshots are operational artifacts produced by `query-snapshot` data sources (see
|
|
108
|
+
* {@link ExecutionMatrixSnapshotRecord}). The collection is optional — when omitted the
|
|
109
|
+
* snapshot CRUD methods throw, which keeps existing callers (no snapshot use case) unaffected.
|
|
110
|
+
*/
|
|
111
|
+
export class ExecutionMatrixRuntime {
|
|
112
|
+
rows;
|
|
113
|
+
failures;
|
|
114
|
+
options;
|
|
115
|
+
claimChain = Promise.resolve();
|
|
116
|
+
snapshots;
|
|
117
|
+
constructor(rows, failures, options = {}) {
|
|
118
|
+
this.rows = rows;
|
|
119
|
+
this.failures = failures;
|
|
120
|
+
this.options = options;
|
|
121
|
+
this.snapshots = options.snapshots;
|
|
122
|
+
}
|
|
123
|
+
withClaimLock(fn) {
|
|
124
|
+
if (this.options.serializeClaims !== false) {
|
|
125
|
+
const run = this.claimChain.then(fn, fn);
|
|
126
|
+
this.claimChain = run.then(() => undefined, () => undefined);
|
|
127
|
+
return run;
|
|
128
|
+
}
|
|
129
|
+
return fn();
|
|
130
|
+
}
|
|
131
|
+
requireSnapshots() {
|
|
132
|
+
if (!this.snapshots) {
|
|
133
|
+
throw new Error('ExecutionMatrixRuntime: snapshots collection not configured (pass options.snapshots or use the runtime factory)');
|
|
134
|
+
}
|
|
135
|
+
return this.snapshots;
|
|
136
|
+
}
|
|
137
|
+
async insertRuntimeRow(row) {
|
|
138
|
+
const id = await this.rows.insert(row);
|
|
139
|
+
return id;
|
|
140
|
+
}
|
|
141
|
+
async getRecord(matrixRowId) {
|
|
142
|
+
const doc = await this.rows.getByKey(matrixRowId);
|
|
143
|
+
return doc ? doc : null;
|
|
144
|
+
}
|
|
145
|
+
async listRecords(opts) {
|
|
146
|
+
const filter = buildMatrixRowReadFilter(opts.matrixCatalogId, opts.matrixRunId, opts.graphId, opts.status, opts.extraFilter);
|
|
147
|
+
const list = await this.rows.readMany(filter, {
|
|
148
|
+
limit: opts.limit ?? 200,
|
|
149
|
+
sort: opts.sort ?? { materializationOrder: 1, updatedAt: 1 },
|
|
150
|
+
mergeCache: true,
|
|
151
|
+
});
|
|
152
|
+
return list;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Batch read execution slots for many source keys across one or more matrix catalogs, then
|
|
156
|
+
* {@link rollupSourceExecutionStatuses}.
|
|
157
|
+
*
|
|
158
|
+
* Uses {@link listRecords} with `extraFilter` `{ [sourceKeyPath]: { $in: sourceKeys } }` per scope.
|
|
159
|
+
*/
|
|
160
|
+
async batchLookupSourceExecutionStatuses(opts) {
|
|
161
|
+
const limitPerScope = opts.limitPerScope ?? 5000;
|
|
162
|
+
const globalCap = opts.globalRowCap ?? 50_000;
|
|
163
|
+
const sourceKeyPath = opts.sourceKeyPath ?? `input.${RUNTIME_ROW_INPUT_SOURCE_ID_KEY}`;
|
|
164
|
+
const extraFilter = {
|
|
165
|
+
[sourceKeyPath]: { $in: [...opts.sourceKeys] },
|
|
166
|
+
};
|
|
167
|
+
const allRows = [];
|
|
168
|
+
for (const scope of opts.scopes) {
|
|
169
|
+
if (allRows.length >= globalCap)
|
|
170
|
+
break;
|
|
171
|
+
const take = Math.min(limitPerScope, globalCap - allRows.length);
|
|
172
|
+
const rows = await this.listRecords({
|
|
173
|
+
matrixCatalogId: scope.matrixCatalogId,
|
|
174
|
+
matrixRunId: scope.matrixRunId,
|
|
175
|
+
extraFilter,
|
|
176
|
+
limit: take,
|
|
177
|
+
});
|
|
178
|
+
allRows.push(...rows);
|
|
179
|
+
}
|
|
180
|
+
const graphIds = rollupGraphIdsUnion(opts.scopes);
|
|
181
|
+
return rollupSourceExecutionStatuses(allRows, { sourceKeyPath, graphIds });
|
|
182
|
+
}
|
|
183
|
+
async getStatusCounts(matrixCatalogId, graphId, matrixRunId) {
|
|
184
|
+
const rows = await this.listRecords({ matrixCatalogId, matrixRunId, limit: 10_000 });
|
|
185
|
+
const out = emptyCounts();
|
|
186
|
+
for (const r of rows) {
|
|
187
|
+
for (const step of r.execution) {
|
|
188
|
+
if (step.graphId !== graphId)
|
|
189
|
+
continue;
|
|
190
|
+
const st = normalizeExecutionMatrixStatus(step.status);
|
|
191
|
+
if (st)
|
|
192
|
+
out[st] += 1;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Count matrix rows matching a Mongo-style filter (same shapes as {@link listRecords} / xronox).
|
|
199
|
+
* Uses {@link XronoxCollection.countMatching} when the backing collection implements it; otherwise
|
|
200
|
+
* falls back to a capped {@link readMany} (up to `readManyFallbackCap` documents).
|
|
201
|
+
*/
|
|
202
|
+
async countRowsMatching(filter, readManyFallbackCap = 100_000) {
|
|
203
|
+
const coll = this.rows;
|
|
204
|
+
if (typeof coll.countMatching === 'function') {
|
|
205
|
+
return await coll.countMatching(filter);
|
|
206
|
+
}
|
|
207
|
+
const list = await this.rows.readMany(filter, { limit: readManyFallbackCap, mergeCache: true });
|
|
208
|
+
return list.length;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Count failure audit documents for dashboards / alerts via xronox `readMany`
|
|
212
|
+
* (best-effort; cap via `readManyCap` for very large collections).
|
|
213
|
+
*
|
|
214
|
+
* Prefer this API (or {@link listFailureRecords}) over calling the failures collection's
|
|
215
|
+
* `readMany` directly so filter shapes stay aligned with runtime indexing.
|
|
216
|
+
*/
|
|
217
|
+
async countFailureRecords(opts, readManyCap = 50_000) {
|
|
218
|
+
const filter = buildFailureRecordsReadFilter(opts);
|
|
219
|
+
const docs = await this.failures.readMany(filter, { limit: readManyCap, mergeCache: true });
|
|
220
|
+
return docs.length;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* List failure audit documents through the runtime (newest first by default: `createdAt: -1`).
|
|
224
|
+
*
|
|
225
|
+
* @param readManyCap Upper bound on documents read from storage (default `50_000`).
|
|
226
|
+
* Effective row limit is `min(opts.limit ?? 200, readManyCap)`.
|
|
227
|
+
*/
|
|
228
|
+
async listFailureRecords(opts, readManyCap = 50_000) {
|
|
229
|
+
const filter = buildFailureRecordsReadFilter(opts);
|
|
230
|
+
const limit = Math.min(opts.limit ?? 200, readManyCap);
|
|
231
|
+
const list = await this.failures.readMany(filter, {
|
|
232
|
+
limit,
|
|
233
|
+
...(opts.skip !== undefined ? { skip: opts.skip } : {}),
|
|
234
|
+
sort: opts.sort ?? { createdAt: -1 },
|
|
235
|
+
mergeCache: true,
|
|
236
|
+
});
|
|
237
|
+
return list;
|
|
238
|
+
}
|
|
239
|
+
/** Read one failure audit document by primary key (`failureId`). */
|
|
240
|
+
async getFailureRecord(failureId) {
|
|
241
|
+
const doc = await this.failures.getByKey(failureId);
|
|
242
|
+
return doc ? doc : null;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Latest failure for a matrix row + graph (by `createdAt`, newest first).
|
|
246
|
+
* Optional `matrixCatalogId` tightens the filter when the caller knows it.
|
|
247
|
+
*/
|
|
248
|
+
async getLatestFailureRecordForRowGraph(matrixRowId, graphId, opts) {
|
|
249
|
+
const filter = { matrixRowId, graphId };
|
|
250
|
+
if (opts?.matrixCatalogId !== undefined)
|
|
251
|
+
filter.matrixCatalogId = opts.matrixCatalogId;
|
|
252
|
+
const list = await this.failures.readMany(filter, {
|
|
253
|
+
limit: 1,
|
|
254
|
+
sort: { createdAt: -1 },
|
|
255
|
+
mergeCache: true,
|
|
256
|
+
});
|
|
257
|
+
const first = list[0];
|
|
258
|
+
return first ? first : null;
|
|
259
|
+
}
|
|
260
|
+
async claimNext(opts) {
|
|
261
|
+
return this.withClaimLock(() => this._claimNextInner(opts));
|
|
262
|
+
}
|
|
263
|
+
async claimRecord(opts) {
|
|
264
|
+
return this.withClaimLock(() => this._claimRecordInner(opts));
|
|
265
|
+
}
|
|
266
|
+
async _claimNextInner(opts) {
|
|
267
|
+
const from = (opts.fromStatuses ?? ['not-started']).map((s) => assertExecutionMatrixStatus(s));
|
|
268
|
+
const candidates = await this.listRecords({
|
|
269
|
+
matrixCatalogId: opts.matrixCatalogId,
|
|
270
|
+
matrixRunId: opts.matrixRunId,
|
|
271
|
+
graphId: opts.graphId,
|
|
272
|
+
limit: 5000,
|
|
273
|
+
sort: { materializationOrder: 1, updatedAt: 1 },
|
|
274
|
+
extraFilter: opts.extraFilter,
|
|
275
|
+
});
|
|
276
|
+
for (const row of candidates) {
|
|
277
|
+
if (!rowMatchesExtraFilter(row, opts.extraFilter))
|
|
278
|
+
continue;
|
|
279
|
+
const idx = row.execution.findIndex((e) => e.graphId === opts.graphId && from.includes(e.status));
|
|
280
|
+
if (idx < 0)
|
|
281
|
+
continue;
|
|
282
|
+
const fresh = await this.rows.getByKey(row.matrixRowId);
|
|
283
|
+
if (!fresh)
|
|
284
|
+
continue;
|
|
285
|
+
const cur = fresh;
|
|
286
|
+
const j = cur.execution.findIndex((e) => e.graphId === opts.graphId && from.includes(e.status));
|
|
287
|
+
if (j < 0)
|
|
288
|
+
continue;
|
|
289
|
+
const now = isoNow();
|
|
290
|
+
const nextExec = cur.execution.map((e, i) => i === j
|
|
291
|
+
? {
|
|
292
|
+
...e,
|
|
293
|
+
status: 'in-progress',
|
|
294
|
+
start: now,
|
|
295
|
+
lastUpdated: now,
|
|
296
|
+
...(opts.workerId ? { workerId: opts.workerId } : {}),
|
|
297
|
+
}
|
|
298
|
+
: e);
|
|
299
|
+
const next = {
|
|
300
|
+
...cur,
|
|
301
|
+
execution: nextExec,
|
|
302
|
+
updatedAt: now,
|
|
303
|
+
claimVersion: (cur.claimVersion ?? 0) + 1,
|
|
304
|
+
};
|
|
305
|
+
await this.rows.update(cur.matrixRowId, next);
|
|
306
|
+
return { ok: true, record: next, graphId: opts.graphId, stepIndex: j };
|
|
307
|
+
}
|
|
308
|
+
return { ok: false, reason: 'no_eligible_row' };
|
|
309
|
+
}
|
|
310
|
+
async _claimRecordInner(opts) {
|
|
311
|
+
const from = (opts.fromStatuses ?? ['not-started']).map((s) => assertExecutionMatrixStatus(s));
|
|
312
|
+
const cur = await this.getRecord(opts.matrixRowId);
|
|
313
|
+
if (!cur)
|
|
314
|
+
return { ok: false, reason: 'row_not_found' };
|
|
315
|
+
if (!rowMatchesExtraFilter(cur, opts.extraFilter))
|
|
316
|
+
return { ok: false, reason: 'no_eligible_row' };
|
|
317
|
+
const j = cur.execution.findIndex((e) => e.graphId === opts.graphId && from.includes(e.status));
|
|
318
|
+
if (j < 0)
|
|
319
|
+
return { ok: false, reason: 'no_eligible_row' };
|
|
320
|
+
const now = isoNow();
|
|
321
|
+
const nextExec = cur.execution.map((e, i) => i === j
|
|
322
|
+
? {
|
|
323
|
+
...e,
|
|
324
|
+
status: 'in-progress',
|
|
325
|
+
start: now,
|
|
326
|
+
lastUpdated: now,
|
|
327
|
+
...(opts.workerId ? { workerId: opts.workerId } : {}),
|
|
328
|
+
}
|
|
329
|
+
: e);
|
|
330
|
+
const next = {
|
|
331
|
+
...cur,
|
|
332
|
+
execution: nextExec,
|
|
333
|
+
updatedAt: now,
|
|
334
|
+
claimVersion: (cur.claimVersion ?? 0) + 1,
|
|
335
|
+
};
|
|
336
|
+
await this.rows.update(cur.matrixRowId, next);
|
|
337
|
+
return { ok: true, record: next, graphId: opts.graphId, stepIndex: j };
|
|
338
|
+
}
|
|
339
|
+
/** Persist `jobId` on the in-progress execution slot for `graphId` (immediately before `executeGraph`). */
|
|
340
|
+
async setExecutionStepJobId(matrixRowId, graphId, jobId) {
|
|
341
|
+
const now = isoNow();
|
|
342
|
+
const cur = await this.getRecord(matrixRowId);
|
|
343
|
+
if (!cur)
|
|
344
|
+
throw new Error(`setExecutionStepJobId: row not found ${matrixRowId}`);
|
|
345
|
+
const j = cur.execution.findIndex((e) => e.graphId === graphId && e.status === 'in-progress');
|
|
346
|
+
if (j < 0)
|
|
347
|
+
throw new Error(`setExecutionStepJobId: no in-progress slot for graph ${graphId}`);
|
|
348
|
+
const nextExec = cur.execution.map((e, i) => i === j ? { ...e, jobId, lastUpdated: now } : e);
|
|
349
|
+
await this.rows.update(matrixRowId, {
|
|
350
|
+
...cur,
|
|
351
|
+
execution: nextExec,
|
|
352
|
+
updatedAt: now,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
async markCompleted(matrixRowId, graphId, inference, attemptMeta) {
|
|
356
|
+
const cur = await this.getRecord(matrixRowId);
|
|
357
|
+
if (!cur)
|
|
358
|
+
throw new Error(`markCompleted: row not found ${matrixRowId}`);
|
|
359
|
+
const now = isoNow();
|
|
360
|
+
const lastAttempt = buildLastAttempt('completed', now, attemptMeta);
|
|
361
|
+
const nextExec = cur.execution.map((e) => e.graphId === graphId && e.status === 'in-progress'
|
|
362
|
+
? { ...e, status: 'completed', end: now, lastUpdated: now, lastAttempt }
|
|
363
|
+
: e);
|
|
364
|
+
const next = {
|
|
365
|
+
...cur,
|
|
366
|
+
execution: nextExec,
|
|
367
|
+
inferences: [...cur.inferences, inference],
|
|
368
|
+
updatedAt: now,
|
|
369
|
+
};
|
|
370
|
+
await this.rows.update(matrixRowId, next);
|
|
371
|
+
}
|
|
372
|
+
async markFailed(matrixRowId, graphId, reason, failureExtras, attemptMeta) {
|
|
373
|
+
const cur = await this.getRecord(matrixRowId);
|
|
374
|
+
if (!cur)
|
|
375
|
+
throw new Error(`markFailed: row not found ${matrixRowId}`);
|
|
376
|
+
const now = isoNow();
|
|
377
|
+
const lastAttempt = buildLastAttempt('failed', now, attemptMeta);
|
|
378
|
+
const nextExec = cur.execution.map((e) => e.graphId === graphId && e.status === 'in-progress'
|
|
379
|
+
? { ...e, status: 'failed', end: now, lastUpdated: now, reason, lastAttempt }
|
|
380
|
+
: e);
|
|
381
|
+
const next = {
|
|
382
|
+
...cur,
|
|
383
|
+
execution: nextExec,
|
|
384
|
+
updatedAt: now,
|
|
385
|
+
};
|
|
386
|
+
await this.rows.update(matrixRowId, next);
|
|
387
|
+
const failure = {
|
|
388
|
+
failureId: '',
|
|
389
|
+
matrixRowId,
|
|
390
|
+
matrixCatalogId: cur.matrixCatalogId,
|
|
391
|
+
matrixItemId: cur.matrixItemId,
|
|
392
|
+
matrixRunId: cur.matrixRunId,
|
|
393
|
+
graphId,
|
|
394
|
+
reason,
|
|
395
|
+
inputSnapshot: cur.input,
|
|
396
|
+
...failureExtras,
|
|
397
|
+
createdAt: now,
|
|
398
|
+
};
|
|
399
|
+
await this.failures.insert(failure);
|
|
400
|
+
}
|
|
401
|
+
async markSkipped(matrixRowId, graphId, reason) {
|
|
402
|
+
const cur = await this.getRecord(matrixRowId);
|
|
403
|
+
if (!cur)
|
|
404
|
+
throw new Error(`markSkipped: row not found ${matrixRowId}`);
|
|
405
|
+
const now = isoNow();
|
|
406
|
+
const nextExec = cur.execution.map((e) => e.graphId === graphId && e.status === 'not-started'
|
|
407
|
+
? {
|
|
408
|
+
...e,
|
|
409
|
+
status: 'skipped',
|
|
410
|
+
end: now,
|
|
411
|
+
lastUpdated: now,
|
|
412
|
+
reason,
|
|
413
|
+
}
|
|
414
|
+
: e);
|
|
415
|
+
const next = {
|
|
416
|
+
...cur,
|
|
417
|
+
execution: nextExec,
|
|
418
|
+
updatedAt: now,
|
|
419
|
+
};
|
|
420
|
+
await this.rows.update(matrixRowId, next);
|
|
421
|
+
}
|
|
422
|
+
/** Apply condition evaluation: mark steps skipped when conditions object is not satisfied (host calls this). */
|
|
423
|
+
async markStepsSkippedByPredicate(matrixRowId, shouldSkip, reason) {
|
|
424
|
+
const cur = await this.getRecord(matrixRowId);
|
|
425
|
+
if (!cur)
|
|
426
|
+
throw new Error(`markStepsSkippedByPredicate: row not found ${matrixRowId}`);
|
|
427
|
+
const now = isoNow();
|
|
428
|
+
const nextExec = cur.execution.map((e) => {
|
|
429
|
+
if (e.status !== 'not-started')
|
|
430
|
+
return e;
|
|
431
|
+
if (!shouldSkip(e))
|
|
432
|
+
return e;
|
|
433
|
+
return { ...e, status: 'skipped', end: now, lastUpdated: now, reason };
|
|
434
|
+
});
|
|
435
|
+
await this.rows.update(matrixRowId, {
|
|
436
|
+
...cur,
|
|
437
|
+
execution: nextExec,
|
|
438
|
+
updatedAt: now,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
/* --------------------------------------------------------------------------
|
|
442
|
+
* Per-status convenience listings (waiting / in-progress / completed / ...)
|
|
443
|
+
* Thin wrappers over `listRecords` that fix the `status` filter.
|
|
444
|
+
* ------------------------------------------------------------------------*/
|
|
445
|
+
/** Rows whose `graphId` slot is in `not-started` (waiting to be claimed). */
|
|
446
|
+
async listWaiting(opts) {
|
|
447
|
+
return this.listRecords({ ...opts, status: 'not-started' });
|
|
448
|
+
}
|
|
449
|
+
/** Rows whose `graphId` slot is currently `in-progress`. */
|
|
450
|
+
async listInProgress(opts) {
|
|
451
|
+
return this.listRecords({ ...opts, status: 'in-progress' });
|
|
452
|
+
}
|
|
453
|
+
/** Rows whose `graphId` slot has `completed`. */
|
|
454
|
+
async listCompleted(opts) {
|
|
455
|
+
return this.listRecords({ ...opts, status: 'completed' });
|
|
456
|
+
}
|
|
457
|
+
/** Rows whose `graphId` slot has `failed`. */
|
|
458
|
+
async listFailed(opts) {
|
|
459
|
+
return this.listRecords({ ...opts, status: 'failed' });
|
|
460
|
+
}
|
|
461
|
+
/** Rows whose `graphId` slot has been `skipped`. */
|
|
462
|
+
async listSkipped(opts) {
|
|
463
|
+
return this.listRecords({ ...opts, status: 'skipped' });
|
|
464
|
+
}
|
|
465
|
+
/* --------------------------------------------------------------------------
|
|
466
|
+
* Snapshots (query-snapshot data source artifacts)
|
|
467
|
+
* ------------------------------------------------------------------------*/
|
|
468
|
+
/** Persist a snapshot record. Throws when the snapshots collection is not configured. */
|
|
469
|
+
async insertSnapshot(record) {
|
|
470
|
+
const coll = this.requireSnapshots();
|
|
471
|
+
const id = await coll.insert(record);
|
|
472
|
+
return id;
|
|
473
|
+
}
|
|
474
|
+
/** Read a snapshot by id. Returns `null` when missing. */
|
|
475
|
+
async getSnapshot(snapshotId) {
|
|
476
|
+
const coll = this.requireSnapshots();
|
|
477
|
+
const doc = await coll.getByKey(snapshotId);
|
|
478
|
+
return doc ? doc : null;
|
|
479
|
+
}
|
|
480
|
+
/** List snapshots filtered by matrix / run / optional `entityType` / `extraFilter`, newest first by default. */
|
|
481
|
+
async listSnapshots(opts) {
|
|
482
|
+
const coll = this.requireSnapshots();
|
|
483
|
+
const filter = buildSnapshotsReadFilter(opts);
|
|
484
|
+
const list = await coll.readMany(filter, {
|
|
485
|
+
limit: opts.limit ?? 200,
|
|
486
|
+
...(opts.skip !== undefined ? { skip: opts.skip } : {}),
|
|
487
|
+
sort: opts.sort ?? { createdAt: -1 },
|
|
488
|
+
mergeCache: true,
|
|
489
|
+
});
|
|
490
|
+
return list;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Count snapshot documents matching optional catalog / run / entity type / `extraFilter`.
|
|
494
|
+
* Implemented via capped **`readMany`** (default **50_000**) — not a precise DB count at huge scale.
|
|
495
|
+
*/
|
|
496
|
+
async countSnapshots(opts, readManyCap = 50_000) {
|
|
497
|
+
const coll = this.requireSnapshots();
|
|
498
|
+
const filter = buildSnapshotsReadFilter(opts);
|
|
499
|
+
const docs = await coll.readMany(filter, { limit: readManyCap, mergeCache: true });
|
|
500
|
+
return docs.length;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
export function createExecutionMatrixRuntime(rows, failures, options) {
|
|
504
|
+
return new ExecutionMatrixRuntime(rows, failures, options ?? {});
|
|
505
|
+
}
|
|
506
|
+
//# sourceMappingURL=runtime-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-store.js","sourceRoot":"","sources":["../../src/execution-matrix/runtime-store.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE1F,SAAS,MAAM;IACb,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,WAAW;IAClB,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,CAAC;QAChB,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAiC,EAAE,MAAgC;IAChG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,GAAG,GAAY,GAAc,CAAC;QAClC,KAAK,MAAM,CAAC,IAAI,KA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ACpC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,OAAO,IAAkD,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,cAAc,CAAC,IAA2B,EAAE,cAAsB,MAAM;QAC5E,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACnF,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAED,MAAM,UAAU,4BAA4B,CAC1C,IAA+C,EAC/C,QAAmD,EACnD,OAGC;IAED,OAAO,IAAI,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot transform runner: executes the inline JS source declared on a `query-snapshot`
|
|
3
|
+
* data source under `node:vm` with a wall-clock timeout.
|
|
4
|
+
*
|
|
5
|
+
* **Sandbox is best-effort, NOT a security boundary.** `node:vm` shares the same V8 process and
|
|
6
|
+
* does not isolate prototype tampering or long synchronous loops perfectly. Hosts that expose this
|
|
7
|
+
* to untrusted authors must add their own process-level isolation. We intentionally do not pass
|
|
8
|
+
* `require`, `process`, network globals, or filesystem APIs into the sandbox.
|
|
9
|
+
*/
|
|
10
|
+
import { type ExecutionMatrixSnapshotRecord, type SnapshotTransform } from './contracts.js';
|
|
11
|
+
/** Result of running a snapshot transform — payload is whatever the function returns. */
|
|
12
|
+
export type SnapshotTransformResult = {
|
|
13
|
+
payload: unknown;
|
|
14
|
+
transformVersion: string;
|
|
15
|
+
};
|
|
16
|
+
export declare class SnapshotTransformError extends Error {
|
|
17
|
+
readonly cause?: unknown | undefined;
|
|
18
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Compile and execute `transform.source` in `node:vm`.
|
|
22
|
+
*
|
|
23
|
+
* Source contract: the script is wrapped in `(function(records, params){ ... })(records, params)` so
|
|
24
|
+
* authors can write either a `return ...` body or a top-level expression. The returned value is
|
|
25
|
+
* the snapshot payload.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runSnapshotTransform(transform: SnapshotTransform, inputs: {
|
|
28
|
+
records: ReadonlyArray<unknown>;
|
|
29
|
+
params?: Record<string, unknown>;
|
|
30
|
+
}): SnapshotTransformResult;
|
|
31
|
+
/**
|
|
32
|
+
* Stable hash over a (selection, sourceIds) pair, used to dedupe / correlate snapshots
|
|
33
|
+
* built from the same source query. SHA-256 hex truncated to 32 chars (sufficient for collision
|
|
34
|
+
* resistance within a single matrix's history).
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildSourceQueryHash(selection: Record<string, unknown> | undefined, sourceIds: ReadonlyArray<string> | undefined): string;
|
|
37
|
+
/**
|
|
38
|
+
* Convenience: build a fully-formed {@link ExecutionMatrixSnapshotRecord} from transform output.
|
|
39
|
+
* Caller still needs to persist via `ExecutionMatrixRuntime.insertSnapshot`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildSnapshotRecord(input: {
|
|
42
|
+
matrixCatalogId: string;
|
|
43
|
+
matrixRunId?: string;
|
|
44
|
+
/** Optional discriminator for {@link ExecutionMatrixRuntime.listSnapshots} / facet APIs. */
|
|
45
|
+
entityType?: string;
|
|
46
|
+
selection?: Record<string, unknown>;
|
|
47
|
+
sourceIds?: string[];
|
|
48
|
+
transformResult: SnapshotTransformResult;
|
|
49
|
+
}): ExecutionMatrixSnapshotRecord;
|
|
50
|
+
//# sourceMappingURL=snapshot-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-runner.d.ts","sourceRoot":"","sources":["../../src/execution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