File size: 2,061 Bytes
ee933ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""FlakeForge V3 — Unified Agent Architecture for Flaky Test Repair.



V3 Key Changes:

- Unified agent: single model generates <think> + <patch> in one pass

- No LLM judge: 6-signal verifiable reward from execution outcomes

- Deep flakiness detection: AST-based module cache, fixture, mock, import, async patterns

- Free-form patches: search/replace hunks instead of hardcoded 7-action space

- GRPO training: group-relative policy optimization with verifiable reward

"""

from .models import (
    FlakeForgeAction,
    FlakeForgeObservation,
    FlakeForgeState,
    RunRecord,
    PatchRecord,
    RewardBreakdown,
    ROOT_CAUSE_TYPES,
    failure_mode_entropy,
    # Backward compatible aliases
    FlakeforgeAction,
    FlakeforgeObservation,
)

from .agent.unified_agent import (
    UnifiedFlakeForgeAgent,
    build_unified_prompt,
    extract_think,
    extract_patch,
    extract_category_from_think,
)

from .server.FlakeForge_environment import (
    FlakeForgeEnvironment,
    create_flakeforge_environment,
)

from .server.reward import compute_verifiable_reward
from .server.patch_applier import apply_search_replace_patch, parse_search_replace_hunks
from .server.deep_flakiness import build_deep_observation_signals

from .client import FlakeForgeClient

__all__ = [
    # Models
    "FlakeForgeAction",
    "FlakeForgeObservation",
    "FlakeForgeState",
    "RunRecord",
    "PatchRecord",
    "RewardBreakdown",
    "ROOT_CAUSE_TYPES",
    "failure_mode_entropy",
    "FlakeforgeAction",
    "FlakeforgeObservation",
    # Agent
    "UnifiedFlakeForgeAgent",
    "build_unified_prompt",
    "extract_think",
    "extract_patch",
    "extract_category_from_think",
    # Environment
    "FlakeForgeEnvironment",
    "create_flakeforge_environment",
    # Reward
    "compute_verifiable_reward",
    # Patch
    "apply_search_replace_patch",
    "parse_search_replace_hunks",
    # Detection
    "build_deep_observation_signals",
    # Client
    "FlakeForgeClient",
]