vedkdev/FlakyTestSleuthOpenEnvRL
FlakySleuth Environment
OpenEnv-compatible RL environment for flaky-test investigation in real Python repos.
Flaky tests are dangerous because they make CI results untrustworthy: real regressions can be ignored as "just flaky," while healthy code can fail randomly and block releases, wasting engineering time and eroding confidence in test signals. We are building this Gym-style RL environment so agents can practice flaky-test triage in realistic repositories, learn to separate true failures from nondeterministic noise, and generate faster, more reliable debugging and fix strategies at scale.
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtBuild Dataset
Input: raw IDoFT CSV (e.g. py-data.csv) Output: processed task CSV (dataset/py_tasks.csv)
python dataset/build_dataset.py --input py-data.csv --output dataset/py_tasks.csvdataset/build_dataset.py flags
Notes:
- Uses live GitHub fetch at exact SHAs.
- Optional
GITHUB_TOKENimproves PR diff fetching/rate limits.
Run Server
python -m server.appQuick check:
curl -s http://localhost:8000/healthRun Inference
Recommended (HF Router/OpenRouter/OpenAI compatible):
export HF_TOKEN=your_hf_token
# optional:
# export API_BASE_URL=https://router.huggingface.co/v1
# export MODEL_NAME=openai/gpt-oss-120b:novita
python inference.py --dataset-path dataset/py_tasks.csv --episodes-per-task 2Run Inference From Space UI
When deployed, the Space homepage serves a UI at / (also /web) that starts inference.py in the background and streams logs live.
UI defaults:
episodes_per_task=1- slider range up to
100 - live ETA estimator:
selected_tasks × episodes_per_task × 180s - warning when ETA may exceed 20 minutes (hackathon guidance)
inference.py flags
Detailed trace to log:
python inference.py \
--dataset-path dataset/py_tasks.csv \
--episodes-per-task 1 \
--task-types classify,root_cause \
--no-compliance-stdout \
--trace-agent \
--history-prune-start-step 12 \
--history-window-turns 4 > agent_trace.log 2>&1OpenEnv CLI
openenv/bin/openenv validate --json
openenv/bin/openenv build
openenv/bin/openenv push