@fabricorg/databricks-testkit 0.7.0 → 0.7.2

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/index.d.cts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { T as TableFixture } from './fixtures-CAWhzIHu.cjs';
2
2
  export { F as FixtureColumn, p as parseFixtureColumns, r as resolveFixtureRows } from './fixtures-CAWhzIHu.cjs';
3
- import { DatabricksRestClient } from '@fabric-harness/databricks';
4
- export { waitForDatabricksRun, waitForDatabricksStatement } from '@fabric-harness/databricks';
5
3
  import { LakebasePoolFactory, LakebaseDatabaseProvider } from '@fabricorg/experiments-db-pool';
6
4
 
7
5
  type TestProfile = 'local' | 'live';
@@ -67,16 +65,29 @@ declare function createDuckDbContext(options?: DuckDbContextOptions): Promise<Ex
67
65
  */
68
66
  declare function normalizeRow(row: Record<string, unknown>): Record<string, unknown>;
69
67
 
70
- /** Structural slice of DatabricksRestClient the workspace context uses (injectable in tests). */
68
+ /** Minimal request boundary used by the live Databricks certification suite. */
71
69
  interface WorkspaceClientLike {
72
70
  get<T>(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<T>;
73
- post<T>(path: string, body?: unknown, query?: Record<string, string | number | boolean | undefined>, options?: unknown): Promise<T>;
71
+ post<T>(path: string, body?: unknown, query?: Record<string, string | number | boolean | undefined>, options?: WorkspaceRequestOptions): Promise<T>;
72
+ }
73
+ interface WorkspaceRequestOptions {
74
+ retry?: 'safe' | 'always' | 'never';
75
+ idempotencyKey?: string;
76
+ maxRetries?: number;
74
77
  }
78
+ interface WorkspaceWaitOptions {
79
+ pollIntervalMs?: number;
80
+ timeoutMs?: number;
81
+ signal?: AbortSignal;
82
+ }
83
+ declare function waitForDatabricksRun(client: WorkspaceClientLike, runId: number, options?: WorkspaceWaitOptions): Promise<Record<string, unknown>>;
84
+ declare function waitForDatabricksStatement(client: WorkspaceClientLike, statementId: string, options?: WorkspaceWaitOptions): Promise<Record<string, unknown>>;
85
+
75
86
  interface WorkspaceContextOptions {
76
87
  env?: Record<string, string | undefined>;
77
88
  /** Schema within the catalog used by qual(); defaults to DBX_TEST_SCHEMA. */
78
89
  schema?: string;
79
- /** Injectable client for hermetic tests; defaults to a DatabricksRestClient from env auth. */
90
+ /** Injectable client for hermetic tests; defaults to the testkit workspace client. */
80
91
  client?: WorkspaceClientLike;
81
92
  /** Injectable fetch for the OAuth M2M exchange. */
82
93
  fetchImpl?: typeof fetch;
@@ -134,7 +145,7 @@ declare function parseStatementRows(response: StatementResponse): Record<string,
134
145
  * explicit env/file OIDC federation → DATABRICKS_CLIENT_ID/SECRET (OAuth
135
146
  * M2M) → DATABRICKS_TOKEN (legacy PAT).
136
147
  */
137
- declare function createClientFromEnv(env: Record<string, string | undefined>, fetchImpl?: typeof fetch): DatabricksRestClient;
148
+ declare function createClientFromEnv(env: Record<string, string | undefined>, fetchImpl?: typeof fetch): WorkspaceClientLike;
138
149
  declare function resolveTokenProvider(host: string, env: Record<string, string | undefined>, fetchImpl?: typeof fetch): string | (() => Promise<string>);
139
150
 
140
151
  /**
@@ -690,6 +701,13 @@ declare function genieCheck(): LiveCheck;
690
701
  declare function mlflowLifecycleCheck(): LiveCheck;
691
702
  declare function featureEngineeringServingCheck(): LiveCheck;
692
703
  declare function modelServingCheck(): LiveCheck;
704
+ /**
705
+ * Live contract for the deterministic chat payload used by
706
+ * `@fabricorg/experiments-evals/databricks`. It is separate from the generic
707
+ * serving check because custom model endpoints may use dataframe payloads and
708
+ * are not valid LLM judges.
709
+ */
710
+ declare function evalJudgeModelServingCheck(): LiveCheck;
693
711
  declare function vectorSearchCheck(): LiveCheck;
694
712
  declare function ragAgentCheck(): LiveCheck;
695
713
  declare function federationSharingCleanRoomsCheck(): LiveCheck;
@@ -712,4 +730,4 @@ declare function createAdvancedTargetPacks(): readonly TargetPack[];
712
730
  declare function createBuiltinTargetPacks(): readonly TargetPack[];
713
731
  declare const builtinTargetPacks: readonly TargetPack[];
714
732
 
715
- export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DashboardResource, DatabricksAdvancedWorkloadsAdapter, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type GenieSpaceResource, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobRepairRunState, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PipelineResource, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RegionalDrCheckOptions, type RegisteredModelResource, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type ServingEndpointResource, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VectorSearchEndpointResource, type VectorSearchIndexResource, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, advancedStreamingCdcCheck, aiBiDashboardCheck, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAdvancedStreamingTargetPack, createAdvancedTargetPacks, createAiBiGenieTargetPack, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFeatureEngineeringTargetPack, createFederationSharingTargetPack, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMlflowLifecycleTargetPack, createMockDatabricksClient, createModelServingTargetPack, createSecurityCostDrTargetPack, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createVectorRagAgentsTargetPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, featureEngineeringServingCheck, federationSharingCleanRoomsCheck, foundationTargetPacks, genieCheck, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, lakeflowConnectCheck, mlflowLifecycleCheck, modelServingCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, ragAgentCheck, regionalDrCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, securityPostureCostCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, vectorSearchCheck, volumeIOCheck, waitForPipelineUpdate };
733
+ export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DashboardResource, DatabricksAdvancedWorkloadsAdapter, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type GenieSpaceResource, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobRepairRunState, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PipelineResource, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RegionalDrCheckOptions, type RegisteredModelResource, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type ServingEndpointResource, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VectorSearchEndpointResource, type VectorSearchIndexResource, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, type WorkspaceWaitOptions, advancedStreamingCdcCheck, aiBiDashboardCheck, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAdvancedStreamingTargetPack, createAdvancedTargetPacks, createAiBiGenieTargetPack, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFeatureEngineeringTargetPack, createFederationSharingTargetPack, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMlflowLifecycleTargetPack, createMockDatabricksClient, createModelServingTargetPack, createSecurityCostDrTargetPack, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createVectorRagAgentsTargetPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, evalJudgeModelServingCheck, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, featureEngineeringServingCheck, federationSharingCleanRoomsCheck, foundationTargetPacks, genieCheck, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, lakeflowConnectCheck, mlflowLifecycleCheck, modelServingCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, ragAgentCheck, regionalDrCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, securityPostureCostCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, vectorSearchCheck, volumeIOCheck, waitForDatabricksRun, waitForDatabricksStatement, waitForPipelineUpdate };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { T as TableFixture } from './fixtures-CAWhzIHu.js';
2
2
  export { F as FixtureColumn, p as parseFixtureColumns, r as resolveFixtureRows } from './fixtures-CAWhzIHu.js';
3
- import { DatabricksRestClient } from '@fabric-harness/databricks';
4
- export { waitForDatabricksRun, waitForDatabricksStatement } from '@fabric-harness/databricks';
5
3
  import { LakebasePoolFactory, LakebaseDatabaseProvider } from '@fabricorg/experiments-db-pool';
6
4
 
7
5
  type TestProfile = 'local' | 'live';
@@ -67,16 +65,29 @@ declare function createDuckDbContext(options?: DuckDbContextOptions): Promise<Ex
67
65
  */
68
66
  declare function normalizeRow(row: Record<string, unknown>): Record<string, unknown>;
69
67
 
70
- /** Structural slice of DatabricksRestClient the workspace context uses (injectable in tests). */
68
+ /** Minimal request boundary used by the live Databricks certification suite. */
71
69
  interface WorkspaceClientLike {
72
70
  get<T>(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<T>;
73
- post<T>(path: string, body?: unknown, query?: Record<string, string | number | boolean | undefined>, options?: unknown): Promise<T>;
71
+ post<T>(path: string, body?: unknown, query?: Record<string, string | number | boolean | undefined>, options?: WorkspaceRequestOptions): Promise<T>;
72
+ }
73
+ interface WorkspaceRequestOptions {
74
+ retry?: 'safe' | 'always' | 'never';
75
+ idempotencyKey?: string;
76
+ maxRetries?: number;
74
77
  }
78
+ interface WorkspaceWaitOptions {
79
+ pollIntervalMs?: number;
80
+ timeoutMs?: number;
81
+ signal?: AbortSignal;
82
+ }
83
+ declare function waitForDatabricksRun(client: WorkspaceClientLike, runId: number, options?: WorkspaceWaitOptions): Promise<Record<string, unknown>>;
84
+ declare function waitForDatabricksStatement(client: WorkspaceClientLike, statementId: string, options?: WorkspaceWaitOptions): Promise<Record<string, unknown>>;
85
+
75
86
  interface WorkspaceContextOptions {
76
87
  env?: Record<string, string | undefined>;
77
88
  /** Schema within the catalog used by qual(); defaults to DBX_TEST_SCHEMA. */
78
89
  schema?: string;
79
- /** Injectable client for hermetic tests; defaults to a DatabricksRestClient from env auth. */
90
+ /** Injectable client for hermetic tests; defaults to the testkit workspace client. */
80
91
  client?: WorkspaceClientLike;
81
92
  /** Injectable fetch for the OAuth M2M exchange. */
82
93
  fetchImpl?: typeof fetch;
@@ -134,7 +145,7 @@ declare function parseStatementRows(response: StatementResponse): Record<string,
134
145
  * explicit env/file OIDC federation → DATABRICKS_CLIENT_ID/SECRET (OAuth
135
146
  * M2M) → DATABRICKS_TOKEN (legacy PAT).
136
147
  */
137
- declare function createClientFromEnv(env: Record<string, string | undefined>, fetchImpl?: typeof fetch): DatabricksRestClient;
148
+ declare function createClientFromEnv(env: Record<string, string | undefined>, fetchImpl?: typeof fetch): WorkspaceClientLike;
138
149
  declare function resolveTokenProvider(host: string, env: Record<string, string | undefined>, fetchImpl?: typeof fetch): string | (() => Promise<string>);
139
150
 
140
151
  /**
@@ -690,6 +701,13 @@ declare function genieCheck(): LiveCheck;
690
701
  declare function mlflowLifecycleCheck(): LiveCheck;
691
702
  declare function featureEngineeringServingCheck(): LiveCheck;
692
703
  declare function modelServingCheck(): LiveCheck;
704
+ /**
705
+ * Live contract for the deterministic chat payload used by
706
+ * `@fabricorg/experiments-evals/databricks`. It is separate from the generic
707
+ * serving check because custom model endpoints may use dataframe payloads and
708
+ * are not valid LLM judges.
709
+ */
710
+ declare function evalJudgeModelServingCheck(): LiveCheck;
693
711
  declare function vectorSearchCheck(): LiveCheck;
694
712
  declare function ragAgentCheck(): LiveCheck;
695
713
  declare function federationSharingCleanRoomsCheck(): LiveCheck;
@@ -712,4 +730,4 @@ declare function createAdvancedTargetPacks(): readonly TargetPack[];
712
730
  declare function createBuiltinTargetPacks(): readonly TargetPack[];
713
731
  declare const builtinTargetPacks: readonly TargetPack[];
714
732
 
715
- export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DashboardResource, DatabricksAdvancedWorkloadsAdapter, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type GenieSpaceResource, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobRepairRunState, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PipelineResource, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RegionalDrCheckOptions, type RegisteredModelResource, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type ServingEndpointResource, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VectorSearchEndpointResource, type VectorSearchIndexResource, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, advancedStreamingCdcCheck, aiBiDashboardCheck, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAdvancedStreamingTargetPack, createAdvancedTargetPacks, createAiBiGenieTargetPack, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFeatureEngineeringTargetPack, createFederationSharingTargetPack, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMlflowLifecycleTargetPack, createMockDatabricksClient, createModelServingTargetPack, createSecurityCostDrTargetPack, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createVectorRagAgentsTargetPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, featureEngineeringServingCheck, federationSharingCleanRoomsCheck, foundationTargetPacks, genieCheck, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, lakeflowConnectCheck, mlflowLifecycleCheck, modelServingCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, ragAgentCheck, regionalDrCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, securityPostureCostCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, vectorSearchCheck, volumeIOCheck, waitForPipelineUpdate };
733
+ export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DashboardResource, DatabricksAdvancedWorkloadsAdapter, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type GenieSpaceResource, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobRepairRunState, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PipelineResource, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RegionalDrCheckOptions, type RegisteredModelResource, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type ServingEndpointResource, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VectorSearchEndpointResource, type VectorSearchIndexResource, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, type WorkspaceWaitOptions, advancedStreamingCdcCheck, aiBiDashboardCheck, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAdvancedStreamingTargetPack, createAdvancedTargetPacks, createAiBiGenieTargetPack, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFeatureEngineeringTargetPack, createFederationSharingTargetPack, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMlflowLifecycleTargetPack, createMockDatabricksClient, createModelServingTargetPack, createSecurityCostDrTargetPack, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createVectorRagAgentsTargetPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, evalJudgeModelServingCheck, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, featureEngineeringServingCheck, federationSharingCleanRoomsCheck, foundationTargetPacks, genieCheck, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, lakeflowConnectCheck, mlflowLifecycleCheck, modelServingCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, ragAgentCheck, regionalDrCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, securityPostureCostCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, vectorSearchCheck, volumeIOCheck, waitForDatabricksRun, waitForDatabricksStatement, waitForPipelineUpdate };
package/dist/index.js CHANGED
@@ -1,13 +1,11 @@
1
1
  import { compareToGolden } from './chunk-MLBZCHRM.js';
2
2
  export { compareToGolden } from './chunk-MLBZCHRM.js';
3
3
  export { createDuckDbContext, normalizeRow } from './chunk-7JVDOSBO.js';
4
- import { createClientFromEnv, createWorkspaceContext, resolveTokenProvider } from './chunk-SCVVMUAF.js';
5
- export { createClientFromEnv, createWorkspaceContext, parseStatementRows, resolveTokenProvider, toNamedParameters } from './chunk-SCVVMUAF.js';
4
+ import { createClientFromEnv, createWorkspaceContext, waitForDatabricksRun, resolveTokenProvider } from './chunk-MV752EAZ.js';
5
+ export { createClientFromEnv, createWorkspaceContext, parseStatementRows, resolveTokenProvider, toNamedParameters, waitForDatabricksRun, waitForDatabricksStatement } from './chunk-MV752EAZ.js';
6
6
  export { parseFixtureColumns, resolveFixtureRows } from './chunk-F3KU6VZS.js';
7
7
  import { mkdir, writeFile, readFile } from 'fs/promises';
8
8
  import { dirname, resolve, basename } from 'path';
9
- import { waitForDatabricksRun } from '@fabric-harness/databricks';
10
- export { waitForDatabricksRun, waitForDatabricksStatement } from '@fabric-harness/databricks';
11
9
  import { LakebaseDatabaseProvider, exchangeLakebaseCredential } from '@fabricorg/experiments-db-pool';
12
10
  import { randomUUID, randomBytes } from 'crypto';
13
11
 
@@ -31,7 +29,7 @@ async function createExecutionContext(options = {}) {
31
29
  const { createDuckDbContext: createDuckDbContext2 } = await import('./duckdb-context-FX23RUBV.js');
32
30
  return createDuckDbContext2({ schema: options.schema });
33
31
  }
34
- const { createWorkspaceContext: createWorkspaceContext2 } = await import('./workspace-context-VLBKMX3V.js');
32
+ const { createWorkspaceContext: createWorkspaceContext2 } = await import('./workspace-context-PCQAQSCO.js');
35
33
  return createWorkspaceContext2({
36
34
  env,
37
35
  schema: options.schema,
@@ -1378,6 +1376,8 @@ function createFoundationTargetPacks() {
1378
1376
  ];
1379
1377
  }
1380
1378
  var foundationTargetPacks = createFoundationTargetPacks();
1379
+
1380
+ // src/jobs-orchestration.ts
1381
1381
  var DatabricksJobsAdapter = class {
1382
1382
  constructor(client) {
1383
1383
  this.client = client;
@@ -1980,6 +1980,12 @@ function parseJson(value, name) {
1980
1980
  throw new Error(`${name} must contain valid JSON`);
1981
1981
  }
1982
1982
  }
1983
+ function isObject(value) {
1984
+ return value !== null && typeof value === "object" && !Array.isArray(value);
1985
+ }
1986
+ function isNonNegativeInteger(value) {
1987
+ return typeof value === "number" && Number.isInteger(value) && value >= 0;
1988
+ }
1983
1989
  function assertNotFailed(label, state) {
1984
1990
  if (typeof state === "string" && /FAIL|ERROR|DELET/i.test(state)) {
1985
1991
  throw new Error(`${label} is ${state}`);
@@ -2214,6 +2220,46 @@ function modelServingCheck() {
2214
2220
  }
2215
2221
  };
2216
2222
  }
2223
+ function evalJudgeModelServingCheck() {
2224
+ const names = ["DBX_TEST_EVAL_SERVING_ENDPOINT"];
2225
+ return {
2226
+ id: "model-eval-judge",
2227
+ description: "Databricks Model Serving satisfies the deterministic evaluator chat contract",
2228
+ configured: (env) => required2(env, names).length === 0,
2229
+ async run({ env, client }) {
2230
+ requireEnv(env, names);
2231
+ const api = adapter(client);
2232
+ const name = env.DBX_TEST_EVAL_SERVING_ENDPOINT;
2233
+ const endpoint = await api.servingEndpoint(name);
2234
+ assertReady("Evaluator serving endpoint", endpoint.state?.ready, ["READY"]);
2235
+ const response = await api.invokeServingEndpoint(name, {
2236
+ messages: [
2237
+ {
2238
+ role: "system",
2239
+ content: 'Answer on the first line with exactly "LABEL: relevant".'
2240
+ },
2241
+ { role: "user", content: "Is this response relevant to this question?" }
2242
+ ],
2243
+ temperature: 0,
2244
+ max_tokens: 32
2245
+ });
2246
+ const choices = Array.isArray(response.choices) ? response.choices : [];
2247
+ const first = choices[0];
2248
+ const message = isObject(first) && isObject(first.message) ? first.message : void 0;
2249
+ const content = typeof message?.content === "string" ? message.content : "";
2250
+ const usage = isObject(response.usage) ? response.usage : void 0;
2251
+ const inputTokens = usage?.prompt_tokens;
2252
+ const outputTokens = usage?.completion_tokens;
2253
+ if (!/^\s*LABEL:\s*relevant\s*$/im.test(content)) {
2254
+ throw new Error("Evaluator serving endpoint did not return the requested label contract");
2255
+ }
2256
+ if (!isNonNegativeInteger(inputTokens) || !isNonNegativeInteger(outputTokens)) {
2257
+ throw new Error("Evaluator serving endpoint did not return integer token usage");
2258
+ }
2259
+ return { endpoint: endpoint.name ?? name, inputTokens, outputTokens };
2260
+ }
2261
+ };
2262
+ }
2217
2263
  function vectorSearchCheck() {
2218
2264
  const names = ["DBX_TEST_VECTOR_ENDPOINT", "DBX_TEST_VECTOR_INDEX"];
2219
2265
  return {
@@ -2706,6 +2752,6 @@ function createBuiltinTargetPacks() {
2706
2752
  }
2707
2753
  var builtinTargetPacks = createBuiltinTargetPacks();
2708
2754
 
2709
- export { DatabricksAdvancedWorkloadsAdapter, DatabricksJobsAdapter, advancedStreamingCdcCheck, aiBiDashboardCheck, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, createAdvancedStreamingTargetPack, createAdvancedTargetPacks, createAiBiGenieTargetPack, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createEphemeralLakebaseBranch, createExecutionContext, createFeatureEngineeringTargetPack, createFederationSharingTargetPack, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMlflowLifecycleTargetPack, createMockDatabricksClient, createModelServingTargetPack, createSecurityCostDrTargetPack, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createVectorRagAgentsTargetPack, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, featureEngineeringServingCheck, federationSharingCleanRoomsCheck, foundationTargetPacks, genieCheck, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, lakeflowConnectCheck, mlflowLifecycleCheck, modelServingCheck, normalizeJobRun, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, performanceBudgetCheck, pipelineRefreshCheck, ragAgentCheck, regionalDrCheck, renderJUnit, resolveLakebaseProject, resolveProfile, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, securityPostureCostCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, vectorSearchCheck, volumeIOCheck, waitForPipelineUpdate };
2755
+ export { DatabricksAdvancedWorkloadsAdapter, DatabricksJobsAdapter, advancedStreamingCdcCheck, aiBiDashboardCheck, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, createAdvancedStreamingTargetPack, createAdvancedTargetPacks, createAiBiGenieTargetPack, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createEphemeralLakebaseBranch, createExecutionContext, createFeatureEngineeringTargetPack, createFederationSharingTargetPack, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMlflowLifecycleTargetPack, createMockDatabricksClient, createModelServingTargetPack, createSecurityCostDrTargetPack, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createVectorRagAgentsTargetPack, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, evalJudgeModelServingCheck, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, featureEngineeringServingCheck, federationSharingCleanRoomsCheck, foundationTargetPacks, genieCheck, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, lakeflowConnectCheck, mlflowLifecycleCheck, modelServingCheck, normalizeJobRun, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, performanceBudgetCheck, pipelineRefreshCheck, ragAgentCheck, regionalDrCheck, renderJUnit, resolveLakebaseProject, resolveProfile, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, securityPostureCostCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, vectorSearchCheck, volumeIOCheck, waitForPipelineUpdate };
2710
2756
  //# sourceMappingURL=index.js.map
2711
2757
  //# sourceMappingURL=index.js.map