Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,23 @@ function makeFakeBlobStorage(prePopulated: string[] = []): FakeBlobStore {
return { blobs, storage, writes };
}

interface DatasetVersionUpdateData {
storagePrefix: string;
manifestPath: string;
documentCount: number;
}

function makePrismaStub() {
const updates: Array<{ where: { id: string }; data: unknown }> = [];
const updates: Array<{
where: { id: string };
data: DatasetVersionUpdateData;
}> = [];
const client = {
datasetVersion: {
update: async (args: { where: { id: string }; data: unknown }) => {
update: async (args: {
where: { id: string };
data: DatasetVersionUpdateData;
}) => {
updates.push(args);
return null as unknown;
},
Expand Down Expand Up @@ -179,11 +191,17 @@ describe("syncLocalDatasetToBlobStorage", () => {
),
).toHaveLength(1);

// DatasetVersion updated
// DatasetVersion updated — manifestPath stored relative to storagePrefix
// so the benchmark materializer's path.join(materializedPath, manifestPath)
// resolves to the file that materializeDataset wrote at <materializedPath>/dataset-manifest.json.
expect(prisma.updates).toHaveLength(1);
expect(prisma.updates[0].where.id).toBe(
"seed-local-samples-mix-private-v1",
);
expect(prisma.updates[0].data.manifestPath).toBe("dataset-manifest.json");
expect(prisma.updates[0].data.storagePrefix).toBe(
"datasets/seed-local-samples-mix-private/seed-local-samples-mix-private-v1",
);
} finally {
cleanup();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,15 @@ export async function syncLocalDatasetToBlobStorage(

// Update DatasetVersion to point at the blob storage (in case the seed
// initially wrote a local path, or to keep documentCount in sync).
// manifestPath is stored relative to storagePrefix — same convention as
// dataset.service.ts createVersion (defaults to "dataset-manifest.json").
// The benchmark materializer downloads files relative to the full storage
// prefix and joins materializedPath + manifestPath to find the manifest.
await prisma.datasetVersion.update({
where: { id: versionId },
data: {
storagePrefix: blobStoragePrefix,
manifestPath: manifestKey,
manifestPath: "dataset-manifest.json",
documentCount: samples.length,
},
});
Expand Down
14 changes: 9 additions & 5 deletions apps/shared/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1841,9 +1841,11 @@ async function seedLocalDatasets() {
// Blob-convention paths. The actual files are uploaded by
// LocalDatasetSyncService on backend startup; until then, these paths
// are placeholders that the sync service confirms / refreshes.
// manifestPath is stored relative to storagePrefix — same convention as
// dataset.service.ts createVersion (defaults to "dataset-manifest.json").
const datasetStoragePath = `datasets/${datasetId}`;
const versionStoragePrefix = `datasets/${datasetId}/${versionId}`;
const versionManifestPath = `groups/${SEED_GROUP_ID}/benchmark/${versionStoragePrefix}/dataset-manifest.json`;
const versionManifestPath = "dataset-manifest.json";

await prisma.dataset.upsert({
where: { id: datasetId },
Expand Down Expand Up @@ -2044,9 +2046,10 @@ async function seedExperimentWorkflows() {
name: `${workflowName} Benchmark`,
workflowVersionId: versionId,
workflowConfigHash: `seed-${slug}`,
evaluatorType: "field-accuracy",
evaluatorType: "schema-aware",
evaluatorConfig: {
metrics: ["field_accuracy", "character_accuracy", "word_accuracy"],
defaultRule: { rule: "fuzzy", fuzzyThreshold: 0.85 },
passThreshold: 0.8,
},
runtimeSettings: { timeout: 600, retries: 2 },
},
Expand All @@ -2057,9 +2060,10 @@ async function seedExperimentWorkflows() {
datasetVersionId: targetVersion.id,
workflowVersionId: versionId,
workflowConfigHash: `seed-${slug}`,
evaluatorType: "field-accuracy",
evaluatorType: "schema-aware",
evaluatorConfig: {
metrics: ["field_accuracy", "character_accuracy", "word_accuracy"],
defaultRule: { rule: "fuzzy", fuzzyThreshold: 0.85 },
passThreshold: 0.8,
},
runtimeSettings: { timeout: 600, retries: 2 },
},
Expand Down
2 changes: 1 addition & 1 deletion apps/temporal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build:logging": "cd ../../packages/logging && npm run build",
"start": "node dist/worker.js",
"start:worker": "node dist/worker.js",
"dev": "ts-node-dev -r tsconfig-paths/register --respawn --transpile-only --rs --watch src --ignore-watch ../../packages src/worker.ts",
"dev": "ts-node-dev -r tsconfig-paths/register --respawn --transpile-only --rs --watch 'src/**/*.ts' --ignore-watch ../../packages src/worker.ts",
"type-check": "tsc --noEmit",
"clean": "rm -rf dist",
"db:generate": "node ../shared/scripts/generate-prisma.js",
Expand Down
Loading