@sixb/core 0.1.3 → 0.1.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.
- package/dist/actions/index.js +17 -18
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/worker.js +4 -4
- package/dist/actions/worker.js.map +1 -1
- package/dist/agents/context-compaction.d.ts +40 -0
- package/dist/agents/context-compaction.d.ts.map +1 -0
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +6 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +42 -37
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/streams.d.ts +17 -1
- package/dist/agents/streams.d.ts.map +1 -1
- package/dist/agents/streams.js +4 -2
- package/dist/agents/streams.js.map +1 -1
- package/dist/agents/types.d.ts +9 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/auth/index.js +7 -3
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +6 -2
- package/dist/authorization/index.js.map +1 -1
- package/dist/bootstrap/index.js +30 -31
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/{chunk-xmggaxg4.js → chunk-1wk20wn3.js} +188 -21
- package/dist/{chunk-xmggaxg4.js.map → chunk-1wk20wn3.js.map} +7 -5
- package/dist/{chunk-1ywq4hzk.js → chunk-1yz3x65y.js} +7 -7
- package/dist/{chunk-gqdd7508.js → chunk-4rh2m6zg.js} +1 -1
- package/dist/{chunk-fmx1sz2h.js → chunk-72q2y8hn.js} +3 -3
- package/dist/{chunk-fmx1sz2h.js.map → chunk-72q2y8hn.js.map} +3 -3
- package/dist/{chunk-f1cyvnrk.js → chunk-7gw7mepb.js} +259 -9
- package/dist/chunk-7gw7mepb.js.map +14 -0
- package/dist/{chunk-wb4051cx.js → chunk-819wnjz8.js} +11 -5
- package/dist/chunk-819wnjz8.js.map +12 -0
- package/dist/{chunk-pxtrxm3p.js → chunk-a09jx26t.js} +1 -1
- package/dist/{chunk-ettb0cy4.js → chunk-afjpa2hs.js} +59 -29
- package/dist/{chunk-ettb0cy4.js.map → chunk-afjpa2hs.js.map} +5 -5
- package/dist/{chunk-177ed2mp.js → chunk-c43qr6s0.js} +229 -97
- package/dist/{chunk-177ed2mp.js.map → chunk-c43qr6s0.js.map} +9 -9
- package/dist/{chunk-261ag4t4.js → chunk-cbkm2vam.js} +3 -3
- package/dist/{chunk-zpw39qhj.js → chunk-dm72y8wt.js} +25 -2
- package/dist/chunk-dm72y8wt.js.map +10 -0
- package/dist/{chunk-kqxgf6kv.js → chunk-drjqm1aa.js} +16 -1
- package/dist/{chunk-kqxgf6kv.js.map → chunk-drjqm1aa.js.map} +3 -3
- package/dist/chunk-dysw7nsm.js.map +1 -1
- package/dist/{chunk-4aw0jwk0.js → chunk-f6erf2vv.js} +1 -1
- package/dist/{chunk-4z3n1dzt.js → chunk-f83ka50g.js} +131 -25
- package/dist/chunk-f83ka50g.js.map +23 -0
- package/dist/{chunk-km4rkj4t.js → chunk-g13869yf.js} +3 -3
- package/dist/{chunk-c8bw2b6c.js → chunk-hbeh8j9w.js} +2 -2
- package/dist/{chunk-n5x5y80a.js → chunk-nzw7sm3b.js} +2 -2
- package/dist/{chunk-3rsf30p4.js → chunk-pn8n8sba.js} +16 -15
- package/dist/{chunk-3rsf30p4.js.map → chunk-pn8n8sba.js.map} +3 -3
- package/dist/{chunk-63te770v.js → chunk-qewtks41.js} +8 -8
- package/dist/{chunk-63te770v.js.map → chunk-qewtks41.js.map} +2 -2
- package/dist/{chunk-4p9rh7jj.js → chunk-rs1wbvy6.js} +1 -1
- package/dist/{chunk-88ppkr54.js → chunk-rte5sm3z.js} +26 -2
- package/dist/chunk-rte5sm3z.js.map +12 -0
- package/dist/{chunk-bv41fmjn.js → chunk-s31d0qmq.js} +57 -20
- package/dist/{chunk-bv41fmjn.js.map → chunk-s31d0qmq.js.map} +8 -7
- package/dist/{chunk-c6cfqydk.js → chunk-sxwk41qa.js} +1 -1
- package/dist/chunk-t0jjkep3.js.map +1 -1
- package/dist/{chunk-d6y2wsfg.js → chunk-tek1qwgm.js} +6 -6
- package/dist/{chunk-d6y2wsfg.js.map → chunk-tek1qwgm.js.map} +1 -1
- package/dist/{chunk-d2adj15j.js → chunk-tkdscva6.js} +1 -1
- package/dist/{chunk-ttba8x6z.js → chunk-tycbzedm.js} +2 -2
- package/dist/{chunk-z8j83gzd.js → chunk-x2yw73hy.js} +1 -1
- package/dist/{chunk-qer6am8w.js → chunk-xdf9yswn.js} +1 -1
- package/dist/execution/agent.js +26 -27
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/primitive.js +26 -27
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.js +27 -28
- package/dist/execution/request.js.map +2 -2
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -53
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/types.d.ts +2 -1
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/materializer/index.js +15 -16
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/index.d.ts +40 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/objects/execution.d.ts +6 -1
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +19 -20
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/link/endpoints.d.ts.map +1 -1
- package/dist/objects/query/executor.d.ts +1 -0
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/explain.d.ts +1 -0
- package/dist/objects/query/explain.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +3 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +30 -5
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +14 -1
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/links.d.ts +25 -0
- package/dist/objects/query/links.d.ts.map +1 -0
- package/dist/objects/query/normalize.d.ts.map +1 -1
- package/dist/objects/query/planner.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts +1 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/pipelines/index.js +15 -16
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/builders.d.ts +33 -4
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/index.d.ts +1 -1
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/internal.js +15 -16
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/run-dispatch.d.ts +1 -0
- package/dist/projections/run-dispatch.d.ts.map +1 -1
- package/dist/projections/types.d.ts +12 -9
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts +6 -5
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/query.d.ts +2 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +2 -2
- package/dist/runtime/create.d.ts +3 -0
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +3 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +2 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -0
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/storage/agents/in-memory.d.ts +4 -0
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +9 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +5 -0
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +1 -1
- package/dist/storage/ai-usage/in-memory.d.ts +2 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +1 -1
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +6 -0
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/index.d.ts +3 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +19 -14
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/objects/in-memory.d.ts +6 -3
- package/dist/storage/objects/in-memory.d.ts.map +1 -1
- package/dist/storage/objects/index.d.ts +3 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/keys.d.ts +16 -0
- package/dist/storage/objects/keys.d.ts.map +1 -0
- package/dist/storage/objects/types.d.ts +33 -6
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/workflow-runs/provider.js +9 -5
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +15 -16
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/effective-storage-contract.d.ts +1 -1
- package/dist/testing/effective-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +455 -40
- package/dist/testing/index.js.map +7 -7
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/object-query-contract.d.ts +1 -1
- package/dist/testing/object-query-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +13 -14
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workflows/index.js +27 -28
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
- package/src/agents/builders.ts +3 -3
- package/src/agents/context-compaction.ts +261 -0
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +18 -9
- package/src/agents/streams.ts +56 -0
- package/src/agents/types.ts +10 -0
- package/src/agents/validation.ts +35 -5
- package/src/http/api-routes.ts +7 -7
- package/src/index.ts +14 -0
- package/src/lake-storage/types.ts +2 -1
- package/src/materializer/telemetry/append.ts +33 -16
- package/src/models/index.ts +71 -0
- package/src/objects/execution.ts +20 -0
- package/src/objects/link/endpoints.ts +2 -1
- package/src/objects/query/executor.ts +42 -11
- package/src/objects/query/explain.ts +11 -0
- package/src/objects/query/index.ts +6 -0
- package/src/objects/query/ir.ts +16 -0
- package/src/objects/query/links.ts +308 -0
- package/src/objects/query/normalize.ts +40 -1
- package/src/objects/query/planner.ts +5 -0
- package/src/objects/query/validate.ts +58 -2
- package/src/projections/builders.ts +220 -15
- package/src/projections/index.ts +1 -0
- package/src/projections/ownership.ts +5 -5
- package/src/projections/registry.ts +9 -3
- package/src/projections/revision.ts +31 -5
- package/src/projections/run-dispatch.ts +10 -1
- package/src/projections/types.ts +13 -9
- package/src/projections/validation.ts +61 -19
- package/src/query.ts +2 -0
- package/src/runtime/create.ts +4 -0
- package/src/runtime/definitions.ts +3 -0
- package/src/runtime/host.ts +2 -0
- package/src/runtime/resolve-definitions.ts +28 -0
- package/src/storage/agents/in-memory.ts +15 -0
- package/src/storage/agents/types.ts +5 -0
- package/src/storage/ai-usage/in-memory.ts +23 -0
- package/src/storage/ai-usage/index.ts +1 -0
- package/src/storage/ai-usage/types.ts +10 -0
- package/src/storage/index.ts +11 -0
- package/src/storage/objects/in-memory.ts +103 -16
- package/src/storage/objects/index.ts +9 -0
- package/src/storage/objects/keys.ts +36 -0
- package/src/storage/objects/types.ts +34 -6
- package/src/storage/ontology/provider-header-validation.ts +2 -2
- package/src/testing/agent-storage-contract.ts +12 -0
- package/src/testing/ai-usage-storage-contract.ts +35 -0
- package/src/testing/effective-storage-contract.ts +194 -4
- package/src/testing/lake-storage-contract.ts +56 -0
- package/src/testing/object-query-contract.ts +208 -1
- package/dist/agents/prompt.d.ts +0 -21
- package/dist/agents/prompt.d.ts.map +0 -1
- package/dist/chunk-4z3n1dzt.js.map +0 -23
- package/dist/chunk-6wetht33.js +0 -89
- package/dist/chunk-6wetht33.js.map +0 -10
- package/dist/chunk-88ppkr54.js.map +0 -12
- package/dist/chunk-f1cyvnrk.js.map +0 -13
- package/dist/chunk-wb4051cx.js.map +0 -12
- package/dist/chunk-zpw39qhj.js.map +0 -10
- package/src/agents/prompt.ts +0 -85
- /package/dist/{chunk-1ywq4hzk.js.map → chunk-1yz3x65y.js.map} +0 -0
- /package/dist/{chunk-gqdd7508.js.map → chunk-4rh2m6zg.js.map} +0 -0
- /package/dist/{chunk-pxtrxm3p.js.map → chunk-a09jx26t.js.map} +0 -0
- /package/dist/{chunk-261ag4t4.js.map → chunk-cbkm2vam.js.map} +0 -0
- /package/dist/{chunk-4aw0jwk0.js.map → chunk-f6erf2vv.js.map} +0 -0
- /package/dist/{chunk-km4rkj4t.js.map → chunk-g13869yf.js.map} +0 -0
- /package/dist/{chunk-c8bw2b6c.js.map → chunk-hbeh8j9w.js.map} +0 -0
- /package/dist/{chunk-n5x5y80a.js.map → chunk-nzw7sm3b.js.map} +0 -0
- /package/dist/{chunk-4p9rh7jj.js.map → chunk-rs1wbvy6.js.map} +0 -0
- /package/dist/{chunk-c6cfqydk.js.map → chunk-sxwk41qa.js.map} +0 -0
- /package/dist/{chunk-d2adj15j.js.map → chunk-tkdscva6.js.map} +0 -0
- /package/dist/{chunk-ttba8x6z.js.map → chunk-tycbzedm.js.map} +0 -0
- /package/dist/{chunk-z8j83gzd.js.map → chunk-x2yw73hy.js.map} +0 -0
- /package/dist/{chunk-qer6am8w.js.map → chunk-xdf9yswn.js.map} +0 -0
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
ensureExecutionRecord,
|
|
7
7
|
executionRecordInputFromRuntime
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-f6erf2vv.js";
|
|
9
9
|
import {
|
|
10
10
|
isStorageSerializationFailure
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-1wk20wn3.js";
|
|
12
12
|
import {
|
|
13
13
|
createCommitId,
|
|
14
14
|
createEventId,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
materializationApplyPhase,
|
|
17
17
|
materializationEventKindOrdinal,
|
|
18
18
|
sha256Canonical
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-72q2y8hn.js";
|
|
20
20
|
import {
|
|
21
21
|
assertPinnedDatasetWatermark
|
|
22
22
|
} from "./chunk-9dzba0f2.js";
|
|
@@ -44,6 +44,12 @@ import {
|
|
|
44
44
|
MaterializationObjectNotFoundError,
|
|
45
45
|
MaterializationValidationError
|
|
46
46
|
} from "./chunk-ry24jbr1.js";
|
|
47
|
+
import {
|
|
48
|
+
ProjectionValidationError,
|
|
49
|
+
isProjectionDefinition,
|
|
50
|
+
resolveExecutionScopeAuthorization,
|
|
51
|
+
validateProjectionsAtStartup
|
|
52
|
+
} from "./chunk-f83ka50g.js";
|
|
47
53
|
import {
|
|
48
54
|
assertKnownProperties,
|
|
49
55
|
normalizeLinkProperties,
|
|
@@ -54,12 +60,6 @@ import {
|
|
|
54
60
|
validatePropertyValue,
|
|
55
61
|
validateTelemetryUnit
|
|
56
62
|
} from "./chunk-rnshztfq.js";
|
|
57
|
-
import {
|
|
58
|
-
ProjectionValidationError,
|
|
59
|
-
isProjectionDefinition,
|
|
60
|
-
resolveExecutionScopeAuthorization,
|
|
61
|
-
validateProjectionsAtStartup
|
|
62
|
-
} from "./chunk-4z3n1dzt.js";
|
|
63
63
|
import {
|
|
64
64
|
assertJsonValue,
|
|
65
65
|
cloneJsonValue,
|
|
@@ -186,14 +186,31 @@ function normalizeProjectionDefinition(projection) {
|
|
|
186
186
|
targetField: projection.targetField
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
+
const properties = Object.entries(projection.properties).sort(([left], [right]) => compareStrings(left, right));
|
|
190
|
+
if (properties.length === 1) {
|
|
191
|
+
const [propertyId, mapping] = properties[0];
|
|
192
|
+
return {
|
|
193
|
+
kind: "telemetry",
|
|
194
|
+
objectTypeId: projection.objectTypeId,
|
|
195
|
+
propertyId,
|
|
196
|
+
objectIdField: projection.objectIdField,
|
|
197
|
+
atField: projection.atField,
|
|
198
|
+
valueField: mapping.valueField,
|
|
199
|
+
unitField: mapping.unitField ?? null
|
|
200
|
+
};
|
|
201
|
+
}
|
|
189
202
|
return {
|
|
190
203
|
kind: "telemetry",
|
|
191
204
|
objectTypeId: projection.objectTypeId,
|
|
192
|
-
propertyId: projection.propertyId,
|
|
193
205
|
objectIdField: projection.objectIdField,
|
|
194
206
|
atField: projection.atField,
|
|
195
|
-
|
|
196
|
-
|
|
207
|
+
properties: Object.fromEntries(properties.map(([propertyId, mapping]) => [
|
|
208
|
+
propertyId,
|
|
209
|
+
{
|
|
210
|
+
valueField: mapping.valueField,
|
|
211
|
+
unitField: mapping.unitField ?? null
|
|
212
|
+
}
|
|
213
|
+
]))
|
|
197
214
|
};
|
|
198
215
|
}
|
|
199
216
|
function projectionColumns(projection) {
|
|
@@ -210,8 +227,10 @@ function projectionColumns(projection) {
|
|
|
210
227
|
return new Set([
|
|
211
228
|
projection.objectIdField,
|
|
212
229
|
projection.atField,
|
|
213
|
-
projection.
|
|
214
|
-
|
|
230
|
+
...Object.values(projection.properties).flatMap((mapping) => [
|
|
231
|
+
mapping.valueField,
|
|
232
|
+
...mapping.unitField === undefined ? [] : [mapping.unitField]
|
|
233
|
+
])
|
|
215
234
|
]);
|
|
216
235
|
}
|
|
217
236
|
function normalizeProperty(property) {
|
|
@@ -453,12 +472,16 @@ function cloneTelemetryProjectionDefinition(projection) {
|
|
|
453
472
|
_tag: "TelemetryProjectionDefinition",
|
|
454
473
|
id: projection.id,
|
|
455
474
|
objectTypeId: projection.objectTypeId,
|
|
456
|
-
propertyId: projection.propertyId,
|
|
457
475
|
datasetId: projection.datasetId,
|
|
458
476
|
objectIdField: projection.objectIdField,
|
|
459
477
|
atField: projection.atField,
|
|
460
|
-
|
|
461
|
-
|
|
478
|
+
properties: Object.fromEntries(Object.entries(projection.properties).map(([propertyId, mapping]) => [
|
|
479
|
+
propertyId,
|
|
480
|
+
{
|
|
481
|
+
valueField: mapping.valueField,
|
|
482
|
+
...mapping.unitField !== undefined ? { unitField: mapping.unitField } : {}
|
|
483
|
+
}
|
|
484
|
+
]))
|
|
462
485
|
};
|
|
463
486
|
}
|
|
464
487
|
function deepFreeze(value) {
|
|
@@ -3972,7 +3995,6 @@ function prepareTelemetryAppend(context, raw) {
|
|
|
3972
3995
|
points: raw.input.points.map((point) => validateTelemetryPoint(context.ontology, point))
|
|
3973
3996
|
});
|
|
3974
3997
|
const inputPointCount = telemetryInputPointCount(input, rawInputPointCount);
|
|
3975
|
-
validateTelemetryBatch(input, inputPointCount);
|
|
3976
3998
|
const ontologyRevision = context.projectionRegistry.ontologyRevision;
|
|
3977
3999
|
const execution = prepareMaterializerExecution(context.projectId, raw.scope);
|
|
3978
4000
|
if (input.source.kind === "runtime") {
|
|
@@ -3991,16 +4013,6 @@ function telemetryInputPointCount(input, rawInputPointCount) {
|
|
|
3991
4013
|
return rawInputPointCount;
|
|
3992
4014
|
return input.points.length;
|
|
3993
4015
|
}
|
|
3994
|
-
function validateTelemetryBatch(input, inputPointCount) {
|
|
3995
|
-
if (input.source.kind === "projection") {
|
|
3996
|
-
if (input.source.sourceRowCount === 0) {
|
|
3997
|
-
throw new MaterializationValidationError("Projection telemetry batches must consume at least one source row; an empty dataset produces no batch commit.");
|
|
3998
|
-
}
|
|
3999
|
-
if (input.source.sourceRowCount !== inputPointCount + input.source.sourceRowsSkipped) {
|
|
4000
|
-
throw new MaterializationValidationError("Projection telemetry sourceRowCount must equal input points plus skipped rows.");
|
|
4001
|
-
}
|
|
4002
|
-
}
|
|
4003
|
-
}
|
|
4004
4016
|
function prepareRuntimeTelemetry(context, input, source, inputPointCount, ontologyRevision) {
|
|
4005
4017
|
const identity = createTimedCommitIdentity({
|
|
4006
4018
|
projectId: context.projectId,
|
|
@@ -4014,6 +4026,7 @@ function prepareProjectionTelemetry(context, input, source, inputPointCount, ont
|
|
|
4014
4026
|
const resolvedProjection = context.projectionRegistry.resolveTelemetry(source.projection.projectionId);
|
|
4015
4027
|
validateTelemetryProjectionDataset(resolvedProjection, source);
|
|
4016
4028
|
validateTelemetryOwnership(resolvedProjection, input);
|
|
4029
|
+
validateTelemetryBatchCardinality(resolvedProjection, source, inputPointCount);
|
|
4017
4030
|
const runIdentity = createProjectionRunMaterializationIdentity({
|
|
4018
4031
|
resolved: resolvedProjection,
|
|
4019
4032
|
datasetVersion: source.datasetVersion,
|
|
@@ -4036,6 +4049,23 @@ function prepareProjectionTelemetry(context, input, source, inputPointCount, ont
|
|
|
4036
4049
|
runIdentity
|
|
4037
4050
|
};
|
|
4038
4051
|
}
|
|
4052
|
+
function validateTelemetryBatchCardinality(resolved, source, inputPointCount) {
|
|
4053
|
+
if (source.sourceRowCount === 0) {
|
|
4054
|
+
throw new MaterializationValidationError("Projection telemetry batches must consume at least one source row; an empty dataset produces no batch commit.");
|
|
4055
|
+
}
|
|
4056
|
+
const mappedPropertyCount = resolved.ownership.telemetry.length;
|
|
4057
|
+
if (mappedPropertyCount === 0) {
|
|
4058
|
+
throw new MaterializationValidationError(`Telemetry projection '${resolved.projectionId}' must own at least one telemetry property.`);
|
|
4059
|
+
}
|
|
4060
|
+
const sourceRowsEmitted = source.sourceRowCount - source.sourceRowsSkipped;
|
|
4061
|
+
const maximumPointCount = sourceRowsEmitted * mappedPropertyCount;
|
|
4062
|
+
if (!Number.isSafeInteger(maximumPointCount)) {
|
|
4063
|
+
throw new MaterializationValidationError(`Telemetry projection '${resolved.projectionId}' batch point capacity exceeds the safe integer range.`);
|
|
4064
|
+
}
|
|
4065
|
+
if (inputPointCount < sourceRowsEmitted || inputPointCount > maximumPointCount) {
|
|
4066
|
+
throw new MaterializationValidationError(`Telemetry projection '${resolved.projectionId}' must emit between ${sourceRowsEmitted} and ${maximumPointCount} points for ${source.sourceRowCount} source rows with ${source.sourceRowsSkipped} skipped.`);
|
|
4067
|
+
}
|
|
4068
|
+
}
|
|
4039
4069
|
function validateTelemetryProjectionDataset(resolved, source) {
|
|
4040
4070
|
if (resolved.datasetId === source.datasetVersion.datasetId)
|
|
4041
4071
|
return;
|
|
@@ -4298,4 +4328,4 @@ function createOntologyMaterializer(input) {
|
|
|
4298
4328
|
}
|
|
4299
4329
|
export { computeOntologyRevision, computeProjectionRevision, computeProjectionOwnershipHash, ProjectionRegistry, createActionIdempotencyKey, createRuntimeIdempotencyKey, createProjectionIdempotencyKey, createRuntimeTelemetryIdempotencyKey, createProjectionTelemetryIdempotencyKey, createCommitIdentity, timestampCommitIdentity, createTimedCommitIdentity, createProjectionMaterializationId, createLinkScopeFingerprint, normalizeJsonProperties, normalizeOntologyEditCommit, normalizeProjectionExecution, normalizeProjectionSourceEntry, normalizeTelemetryAppend, OntologyMaterializer, createOntologyMaterializer };
|
|
4300
4330
|
|
|
4301
|
-
//# debugId=
|
|
4331
|
+
//# debugId=D96E192C1BE0917864756E2164756E21
|