Skip to content
Open
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
153 changes: 1 addition & 152 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"devDependencies": {
"@eslint/js": "10.0.1",
"@jest/globals": "30.5.2",
"@playwright/test": "1.64.1",
"@testing-library/dom": "^10.4.2",
"@testing-library/jest-dom": "7.0.1",
Expand All @@ -68,9 +69,7 @@
"identity-obj-proxy": "3.0.0",
"jest": "30.5.2",
"jest-environment-jsdom": "30.5.2",
"scheduler": "^0.28.0",
"ts-jest": "29.4.15",
"ts-node": "10.9.2",
"typescript": "6.0.3",
"vite": "8.3.5"
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Config/targetFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const MODALITY_LABELS: Readonly<Record<string, string>> = {
}

/** Canonical display order for modalities; unknown values are appended last. */
export const MODALITY_ORDER: readonly string[] = [
const MODALITY_ORDER: readonly string[] = [
'text',
'image_path',
'audio_path',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Datasets/datasetQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const DATASET_SORTS = [

export type DatasetSort = (typeof DATASET_SORTS)[number]

export const DEFAULT_DATASET_SORT: DatasetSort = 'name'
const DEFAULT_DATASET_SORT: DatasetSort = 'name'

export const DATASET_SORT_LABELS: Record<DatasetSort, string> = {
name: 'Name (A-Z)',
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Datasets/seedExampleQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { catalogPathFromNavigationState, chatOriginFromNavigationState, type Dat

export const MAX_SEED_SEARCH_LENGTH = 1_000
export const DEFAULT_SEED_PAGE_SIZE = 20
export const MIN_SEED_PAGE_SIZE = 1
export const MAX_SEED_PAGE_SIZE = 100
const MIN_SEED_PAGE_SIZE = 1
const MAX_SEED_PAGE_SIZE = 100
export const SEED_PAGE_SIZE_OPTIONS = [20, 50, 100] as const

export const SEED_TYPES = ['prompt', 'objective', 'simulated_conversation'] as const
Expand Down Expand Up @@ -43,7 +43,7 @@ export interface DatasetDetailLocationState {
readonly cursorGeneration: string
}

export function isSeedType(value: string): value is SeedType {
function isSeedType(value: string): value is SeedType {
return SEED_TYPES.some((seedType) => seedType === value)
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Scenarios/ScenarioDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ import { datasetTotalLimit, scenarioDatasetDefaults, scenarioDatasetOptions } fr
import { formatCarriedParameterPreview } from './scenarioLaunchPresentation'
import { normalizeScenarioMarkdown } from './scenarioMarkdown'
import { carriedPresetScenarioParams, seedPresetTechniques, untouchedPresetScenarioParams } from './scenarioPresetSeed'
import { BASELINE_TECHNIQUE } from './scenarioConfigForm'
import {
BASELINE_TECHNIQUE,
exceedsTechniqueLimit,
initialScenarioLaunchForm,
reduceScenarioLaunchForm,
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/components/Scenarios/scenarioLaunchForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ export interface SelectableTechnique extends ScenarioTechniqueSummary {
disabled: boolean
}

export const BASELINE_TECHNIQUE: ScenarioTechniqueSummary = {
name: 'baseline',
description: 'Sends each objective directly to the target for comparison.',
tags: ['baseline', 'single_turn'],
}

/** The related launch-form fields that change together through explicit actions. */
export interface ScenarioLaunchFormState {
targetName: string
Expand Down
14 changes: 0 additions & 14 deletions frontend/src/components/Scenarios/scenarioTechniqueSets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,3 @@ export function techniqueSetMembers(scenario: RegisteredScenario, name: string):
export function techniqueSetName(name: string): string {
return humanizeTechniqueSetName(name)
}

export function techniqueSetDisplayName(scenario: RegisteredScenario, name: string): string {
const displayName = techniqueSetName(name)
return name === scenario.default_technique ? `${displayName} (default)` : displayName
}

export function techniqueSetOptionLabel(scenario: RegisteredScenario, name: string): string {
const count = techniqueSetMembers(scenario, name).length
const countLabel = `${count.toLocaleString()} technique${count === 1 ? '' : 's'}`
const displayName = techniqueSetDisplayName(scenario, name)
return name === scenario.default_technique
? `${displayName} — ${countLabel}`
: `${displayName} (${countLabel})`
}
4 changes: 2 additions & 2 deletions frontend/src/hooks/useScenarioResultHierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import type {
ScenarioRunState,
} from '@/types'

export const HIERARCHY_MAX_NODES = 1000
export const HIERARCHY_CHILD_PAGE_SIZE = 200
const HIERARCHY_MAX_NODES = 1000
const HIERARCHY_CHILD_PAGE_SIZE = 200

export interface HierarchyRootState {
readonly status: 'loading' | 'ready' | 'error'
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { generateClientId } from '@/utils/clientId'
import { decodeBlobErrorAsync, toApiError } from './errors'
import { compatibility, COMPATIBILITY_HEADER } from './compatibility'
import { getGraphScopes } from '../auth/msalConfig'
import { MAX_SEED_SEARCH_LENGTH } from '@/components/Datasets/seedExampleQuery'
import type {
ApplyChatScorerRequest,
ApplyChatScorerResponse,
Expand Down Expand Up @@ -996,8 +997,6 @@ export const scenarioSuitesApi = {
},
}

const MAX_SEED_SEARCH_LENGTH = 1_000

function seedListQuery(params: SeedExampleListParams): Record<string, string | number | readonly string[]> {
if (params.search != null && params.value_pattern != null) {
throw new Error('Supply either literal search or value_pattern, not both.')
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2056,12 +2056,6 @@ export type ScenarioRunEstimateState =
}
| ScenarioRunEstimateResult

export type ScenarioRunEstimator = (
scenarioName: string,
request: ScenarioRunSizeEstimateRequest,
signal?: AbortSignal,
) => Promise<ScenarioRunSizeEstimateResponse>

export interface AttackErrorSummary {
atomic_attack_name: string
objective: string
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/utils/attackAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import type {
import { UUID_PATTERN } from './routeParams'

export const ANALYTICS_PAGE_SIZE = 25
export const ANALYTICS_GROUP_LIMIT = 15
const ANALYTICS_GROUP_LIMIT = 15
export const ANALYTICS_AXIS_LIMIT = 20
export const ANALYTICS_DEBOUNCE_MS = 250
export const ANALYTICS_MAX_PREDICATES = 16
const ANALYTICS_MAX_PREDICATES = 16
export const ANALYTICS_MAX_VALUES = 100
export const ANALYTICS_OUTCOMES: AttackOutcome[] = ['success', 'failure', 'error', 'undetermined']

export const ANALYTICS_ASR_NOTE =
'* Outcome filter active. ASR uses only the selected outcomes and may be 100% when only successes are selected.'
export const ANALYTICS_ASR_DEFINITION =
const ANALYTICS_ASR_DEFINITION =
'Attack success rate is attacker successes among selected decided results. Errors and undetermined results are excluded.'
export const ANALYTICS_ALL_ASR_DEFINITION =
const ANALYTICS_ALL_ASR_DEFINITION =
'Attack success rate uses all selected results as its denominator, including errors and undetermined results.'

export const DEFAULT_ANALYTICS_VIEW: AttackAnalyticsViewState = {
Expand Down
Loading