feat(provider-contract): add classified unit contact aspect

This commit is contained in:
Codex
2026-07-24 09:31:34 +03:00
parent f02a1d4125
commit eab47bc1fa
10 changed files with 501 additions and 31 deletions
@@ -14,26 +14,26 @@ import {
validateL2ExecutionPlan,
} from "../src/index.mjs";
import {
geliosProviderPackageV9,
geliosTelemetryFieldRegistryV2,
} from "../providers/gelios/v9/index.mjs";
geliosProviderPackageV10,
geliosTelemetryFieldRegistryV3,
} from "../providers/gelios/v10/index.mjs";
const positionsConnection = instantiateL2Connection(geliosProviderPackageV9, {
const positionsConnection = instantiateL2Connection(geliosProviderPackageV10, {
tenantId: "tenant-compiler-fixture",
connectionId: "gelios-compiler-fixture",
collectionProfileId: "gelios.positions.current.realtime.v7",
providerCredentialRef: "ndc-credref:provider-compiler-fixture-0001",
});
const positionsPlan = compileL2ExecutionPlan(
geliosProviderPackageV9,
geliosProviderPackageV10,
positionsConnection,
{ telemetryFieldRegistry: geliosTelemetryFieldRegistryV2 },
{ telemetryFieldRegistry: geliosTelemetryFieldRegistryV3 },
);
assert.equal(positionsPlan.schemaVersion, L2_EXECUTION_PLAN_SCHEMA_VERSION);
assert.equal(L2_EXECUTION_PLAN_COMPILER_VERSION, "1.2.0");
assert.deepEqual(L2_EXECUTION_PLAN_SUPPORTED_COMPILER_VERSIONS, ["1.1.0", "1.2.0"]);
assert.equal(positionsPlan.compilerVersion, "1.2.0");
assert.equal(L2_EXECUTION_PLAN_COMPILER_VERSION, "1.3.0");
assert.deepEqual(L2_EXECUTION_PLAN_SUPPORTED_COMPILER_VERSIONS, ["1.1.0", "1.2.0", "1.3.0"]);
assert.equal(positionsPlan.compilerVersion, "1.3.0");
assert.deepEqual(validateL2ExecutionPlan(positionsPlan), { ok: true, errors: [] });
assert.match(positionsPlan.executionPlanDigest, /^sha256:[a-f0-9]{64}$/);
assert.match(positionsPlan.artifacts.packageDigest, /^sha256:[a-f0-9]{64}$/);
@@ -123,9 +123,9 @@ assert.equal(Object.isFrozen(positionsPlan.steps), true);
assert.equal(Object.isFrozen(positionsPlan.graphBlueprint), true);
const clonedPlan = compileL2ExecutionPlan(
structuredClone(geliosProviderPackageV9),
structuredClone(geliosProviderPackageV10),
structuredClone(positionsConnection),
{ telemetryFieldRegistry: structuredClone(geliosTelemetryFieldRegistryV2) },
{ telemetryFieldRegistry: structuredClone(geliosTelemetryFieldRegistryV3) },
);
assert.equal(clonedPlan.executionPlanDigest, positionsPlan.executionPlanDigest);
@@ -151,34 +151,34 @@ assert.equal(
);
assert.throws(
() => compileL2ExecutionPlan(geliosProviderPackageV9, positionsConnection),
() => compileL2ExecutionPlan(geliosProviderPackageV10, positionsConnection),
/telemetry_registry_required/,
);
const profileConnection = instantiateL2Connection(geliosProviderPackageV9, {
const profileConnection = instantiateL2Connection(geliosProviderPackageV10, {
tenantId: "tenant-compiler-fixture",
connectionId: "gelios-profile-compiler-fixture",
collectionProfileId: "gelios.units.profile.cold.v1",
providerCredentialRef: "ndc-credref:provider-compiler-fixture-0001",
});
const profilePlan = compileL2ExecutionPlan(geliosProviderPackageV9, profileConnection);
const profilePlan = compileL2ExecutionPlan(geliosProviderPackageV10, profileConnection);
assert.deepEqual(validateL2ExecutionPlan(profilePlan), { ok: true, errors: [] });
assert.equal(profilePlan.artifacts.telemetryRegistryDigest, undefined);
assert.notEqual(profilePlan.executionPlanDigest, positionsPlan.executionPlanDigest);
assert.deepEqual(profilePlan.graphBlueprint.runtime.mappingRuntime.derivationKinds, []);
for (const collectionProfile of geliosProviderPackageV9.collectionProfiles) {
const connection = instantiateL2Connection(geliosProviderPackageV9, {
for (const collectionProfile of geliosProviderPackageV10.collectionProfiles) {
const connection = instantiateL2Connection(geliosProviderPackageV10, {
tenantId: "tenant-all-profiles-fixture",
connectionId: `connection-${collectionProfile.id.replaceAll(".", "-")}`,
collectionProfileId: collectionProfile.id,
providerCredentialRef: "ndc-credref:provider-all-profiles-fixture",
});
const plan = compileL2ExecutionPlan(
geliosProviderPackageV9,
geliosProviderPackageV10,
connection,
collectionProfile.dataProductId === "fleet.positions.current.v5"
? { telemetryFieldRegistry: geliosTelemetryFieldRegistryV2 }
? { telemetryFieldRegistry: geliosTelemetryFieldRegistryV3 }
: {},
);
assert.deepEqual(validateL2ExecutionPlan(plan), { ok: true, errors: [] });
@@ -188,16 +188,16 @@ for (const collectionProfile of geliosProviderPackageV9.collectionProfiles) {
assert.equal(plan.graphBlueprint.edges.length, plan.steps.length + expectedEntrypoints - 2);
}
const secondConnection = instantiateL2Connection(geliosProviderPackageV9, {
const secondConnection = instantiateL2Connection(geliosProviderPackageV10, {
tenantId: "tenant-compiler-fixture",
connectionId: "gelios-compiler-fixture-two",
collectionProfileId: "gelios.positions.current.realtime.v7",
providerCredentialRef: "ndc-credref:provider-compiler-fixture-0002",
});
const secondPlan = compileL2ExecutionPlan(
geliosProviderPackageV9,
geliosProviderPackageV10,
secondConnection,
{ telemetryFieldRegistry: geliosTelemetryFieldRegistryV2 },
{ telemetryFieldRegistry: geliosTelemetryFieldRegistryV3 },
);
assert.notEqual(secondPlan.executionPlanDigest, positionsPlan.executionPlanDigest);