File size: 3,322 Bytes
aea0016
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

"""Difficulty presets for WorkflowArena."""

from __future__ import annotations

from workflow_arena.models import DifficultyPreset, DifficultyPresetConfig, GraderTarget


PRESET_CONFIGS: dict[DifficultyPreset, DifficultyPresetConfig] = {
    DifficultyPreset.EASY: DifficultyPresetConfig(
        preset=DifficultyPreset.EASY,
        min_tasks=8,
        max_tasks=12,
        edge_probability=0.14,
        duration_min=1,
        duration_max=4,
        priority_min=1,
        priority_max=4,
        worker_count=3,
        deadline_tightness=0.22,
        time_budget_multiplier=None,
        worker_outage_rate=0.0,
        worker_outage_duration_min=0,
        worker_outage_duration_max=0,
        task_retry_failure_rate=0.0,
        max_task_retries=0,
        grader_target=GraderTarget(
            description=(
                "Reward agents that keep workers utilized and avoid obvious idle time on a "
                "small, low-pressure workflow."
            ),
            score_band_hint="0.8+ means near-greedy scheduling, 0.5 is acceptable, below 0.3 is weak.",
        ),
    ),
    DifficultyPreset.MEDIUM: DifficultyPresetConfig(
        preset=DifficultyPreset.MEDIUM,
        min_tasks=12,
        max_tasks=18,
        edge_probability=0.22,
        duration_min=1,
        duration_max=6,
        priority_min=1,
        priority_max=6,
        worker_count=4,
        deadline_tightness=0.40,
        time_budget_multiplier=1.6,
        worker_outage_rate=0.0,
        worker_outage_duration_min=0,
        worker_outage_duration_max=0,
        task_retry_failure_rate=0.0,
        max_task_retries=0,
        grader_target=GraderTarget(
            description=(
                "Reward agents that balance utilization, deadline adherence, and critical-path "
                "awareness on a moderately branching workflow."
            ),
            score_band_hint="0.75+ is strong, 0.45 to 0.75 is competitive, below 0.3 misses core tradeoffs.",
        ),
    ),
    DifficultyPreset.HARD: DifficultyPresetConfig(
        preset=DifficultyPreset.HARD,
        min_tasks=22,
        max_tasks=36,
        edge_probability=0.37,
        duration_min=2,
        duration_max=9,
        priority_min=1,
        priority_max=8,
        worker_count=2,
        deadline_tightness=0.78,
        time_budget_multiplier=1.45,
        worker_outage_rate=0.2,
        worker_outage_duration_min=2,
        worker_outage_duration_max=4,
        task_retry_failure_rate=0.12,
        max_task_retries=1,
        grader_target=GraderTarget(
            description=(
                "Reward agents that identify and schedule long-running critical tasks early while "
                "protecting high-priority deadlines under frequent worker-capacity bottlenecks."
            ),
            score_band_hint="0.7+ is excellent, 0.4 to 0.7 is competent, below 0.25 is poor planning.",
        ),
    ),
}


def get_preset_config(preset: DifficultyPreset) -> DifficultyPresetConfig:
    """Return the immutable config for a preset."""

    return PRESET_CONFIGS[preset].model_copy(deep=True)