Skip to content
Draft
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
3 changes: 1 addition & 2 deletions web/oss/src/components/EvalRunDetails/atoms/table/run.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type {EvaluationRun} from "@agenta/entities/evaluationRun"
import {fetchWorkflowsBatch} from "@agenta/entities/workflow"
import {atomFamily, selectAtom} from "jotai/utils"
import {atomWithQuery} from "jotai-tanstack-query"
Expand All @@ -13,8 +14,6 @@ import {
import {TERMINAL_STATUSES} from "../compare"
import {effectiveProjectIdAtom} from "../run"

import type {EvaluationRun} from "@/agenta-oss-common/lib/hooks/usePreviewEvaluations/types"

export interface EvaluationRunQueryResult {
rawRun: EvaluationRun
camelRun: any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface CompareRunsMenuProps {
interface CandidateRun {
id: string
name: string
status?: string
status?: string | null
description?: string | null
createdAt?: string
testsetNames: string[]
Expand Down
4 changes: 2 additions & 2 deletions web/oss/src/components/EvaluationRunsTablePOC/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {EvaluationRun} from "@agenta/entities/evaluationRun"

import type {InfiniteTableRowBase} from "@/oss/components/InfiniteVirtualTable/types"
import type {WindowingState} from "@/oss/components/InfiniteVirtualTable/types"
import type {SnakeToCamelCaseKeys} from "@/oss/lib/Types"

import type {EvaluationRun} from "@/agenta-oss-common/lib/hooks/usePreviewEvaluations/types"

// The original `@/oss/state/evaluations/legacyAtoms` module no longer exists, and `legacy`
// is only ever read through `any` casts — represented as an opaque record (per WP-4i).
export type LegacyAutoEvaluation = Record<string, unknown>
Expand Down
4 changes: 3 additions & 1 deletion web/oss/src/lib/hooks/usePreviewEvaluations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ interface PreviewEvaluationsQueryState {
error: unknown
}
import {searchQueryAtom} from "./states/queryFilterAtoms"
import {EnrichedEvaluationRun, EvaluationRun} from "./types"
import type {EvaluationRun} from "@agenta/entities/evaluationRun"

import {EnrichedEvaluationRun} from "./types"

const SCENARIOS_ENDPOINT = "/evaluations/scenarios/"

Expand Down
40 changes: 1 addition & 39 deletions web/oss/src/lib/hooks/usePreviewEvaluations/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type {EvaluationRun} from "@agenta/entities/evaluationRun"
import type {Workflow} from "@agenta/entities/workflow"

import {PreviewTestset, SnakeToCamelCaseKeys, WorkspaceMember} from "@/oss/lib/Types"
Expand Down Expand Up @@ -37,45 +38,6 @@ export type EvaluationRunDataStep =
}

export type IEvaluationRunDataStep = SnakeToCamelCaseKeys<EvaluationRunDataStep>
export interface EvaluationRun {
/** Unique identifier for the evaluation run */
id: string
/** Display name for the run */
name: string
/** Optional description text for the run */
description: string
/** ISO timestamp of when the run was created */
created_at: string
/** ISO timestamp of when the run was last updated (present on backend run payloads) */
updated_at?: string
/** ID of the user who created the run */
created_by_id: string
/** Optional metadata object (arbitrary key-value pairs) */
meta: Record<string, any>
/** Flags associated with the run (internal use) */
flags: Record<string, any>
/** Current status of the run (e.g., "pending", "completed") */
status: string
data: {
/** Array of evaluation steps that define execution flow */
steps: EvaluationRunDataStep[]
/** Mappings define how to extract values from steps for display or evaluation */
mappings: {
/** Type of the mapping, determines what the value represents */
kind: "input" | "ground_truth" | "application" | "evaluator"
/** Display name for the mapped value */
name: string
/** Path reference to the data inside a step */
step: {
/** The step key this mapping belongs to */
key: string
/** Path within the step data (e.g., 'country' or 'data.outputs.metric') */
path: string
}
}[]
}
}

export interface EnrichedEvaluationRun extends SnakeToCamelCaseKeys<EvaluationRun> {
/** All distinct testsets referenced in this run */
testsets: PreviewTestset[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const evaluationRunStepReferenceSchema = z.object({
slug: z.string().nullable().optional(),
version: z.coerce.number().nullable().optional(),
})
export type EvaluationRunStepReference = z.infer<typeof evaluationRunStepReferenceSchema>

export const evaluationRunDataStepSchema = z.object({
key: z.string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*/

import type {EvaluationResult} from "../core"
import type {EvaluationRunStepReference} from "../core/schema"

import type {HydratedScenarioRow, HydratableScenario} from "./hydrateScenariosTransform"

Expand All @@ -54,7 +55,8 @@ export interface RunStep {
*/
type: string
origin?: string | null
references?: Record<string, {id: string; slug?: string; version?: string} | null> | null
/** Shape comes from the validated core schema; do not redeclare it here. */
references?: Record<string, EvaluationRunStepReference | null> | null
inputs?: {key: string}[] | null
}

Expand Down Expand Up @@ -108,7 +110,7 @@ export interface ColumnGroup {
/** Stable cache key for this group — useful for grouping in renderers. */
key: string
/** The step.references that drove the grouping (preserved for downstream code). */
refs: Record<string, {id?: string; slug?: string} | null | undefined> | null
refs: Record<string, EvaluationRunStepReference | null | undefined> | null
}

export interface ResolvedColumn {
Expand Down
Loading