refactor: remove depth/generationProfile tiering, use explicit runs
- Replace TestDepth ('quick'|'standard'|'thorough') with explicit runs:number
- Remove GenerationProfile type and all generationProfile parameters
- schema-to-arbitrary.ts now uses fixed defaults (string≤128, array≤10, props≤6)
- Delete src/cli/core/generation-profile.ts
- Remove --generation-profile CLI flag from verify and qualify
- Remove depth field from PresetDefinition and all preset scaffolds
- Remove generationProfiles from Config interface
- Update all test files: depth:'quick' → runs:10
- Remove depth from all fixture configs
- Update builders.ts, mutation.ts, outbound-mock-runtime.ts
- Build: clean | Tests: 849 pass, 0 fail
This commit is contained in:
+1
-1
@@ -201,7 +201,7 @@ export interface ApophisTestDecorations {
|
||||
|
||||
// Forward declarations to avoid circular deps — these are defined in sibling modules
|
||||
export interface TestConfig {
|
||||
readonly depth?: import('./formula.js').TestDepth
|
||||
readonly runs?: number
|
||||
readonly scope?: string
|
||||
readonly seed?: number
|
||||
readonly timeout?: number
|
||||
|
||||
+10
-34
@@ -7,11 +7,8 @@
|
||||
// Test: Configuration
|
||||
// ============================================================================
|
||||
|
||||
export type TestDepth = 'quick' | 'standard' | 'thorough' | { runs: number }
|
||||
|
||||
export interface TestConfig {
|
||||
readonly depth?: TestDepth
|
||||
readonly generationProfile?: GenerationProfile
|
||||
readonly runs?: number
|
||||
readonly scope?: string
|
||||
readonly seed?: number
|
||||
readonly timeout?: number
|
||||
@@ -204,49 +201,28 @@ export interface ChaosConfig {
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Depth Configuration
|
||||
// Test run configuration
|
||||
// ============================================================================
|
||||
|
||||
export interface DepthConfig {
|
||||
export interface RunConfig {
|
||||
readonly contractRuns: number
|
||||
readonly propertyRuns: number
|
||||
readonly statefulRuns: number
|
||||
readonly maxCommands: number
|
||||
}
|
||||
|
||||
export type GenerationProfile = 'quick' | 'standard' | 'thorough'
|
||||
const DEFAULT_RUNS = 50
|
||||
|
||||
export const DEPTH_CONFIGS: Record<'quick' | 'standard' | 'thorough', DepthConfig> = {
|
||||
quick: { contractRuns: 10, propertyRuns: 50, statefulRuns: 5, maxCommands: 10 },
|
||||
standard: { contractRuns: 50, propertyRuns: 100, statefulRuns: 20, maxCommands: 30 },
|
||||
thorough: { contractRuns: 200, propertyRuns: 1000, statefulRuns: 100, maxCommands: 50 }
|
||||
}
|
||||
|
||||
export function resolveDepth(depth: TestDepth): DepthConfig {
|
||||
if (typeof depth === 'string') {
|
||||
return DEPTH_CONFIGS[depth]
|
||||
}
|
||||
export function resolveRuns(runs: number | undefined): RunConfig {
|
||||
const r = runs ?? DEFAULT_RUNS
|
||||
return {
|
||||
contractRuns: depth.runs,
|
||||
propertyRuns: depth.runs,
|
||||
statefulRuns: Math.max(1, Math.floor(depth.runs / 10)),
|
||||
maxCommands: Math.max(5, Math.floor(depth.runs / 5)),
|
||||
contractRuns: r,
|
||||
propertyRuns: r * 2,
|
||||
statefulRuns: Math.max(1, Math.floor(r / 10)),
|
||||
maxCommands: Math.max(5, Math.floor(r / 2)),
|
||||
}
|
||||
}
|
||||
|
||||
export function resolveGenerationProfile(depth: TestDepth | undefined): GenerationProfile {
|
||||
if (depth === undefined) {
|
||||
return 'standard'
|
||||
}
|
||||
if (typeof depth === 'string') {
|
||||
return depth
|
||||
}
|
||||
|
||||
if (depth.runs <= 25) return 'quick'
|
||||
if (depth.runs >= 250) return 'thorough'
|
||||
return 'standard'
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Test: Results
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user