Pranjal Parashar commited on
Commit
56ad3a2
·
unverified ·
2 Parent(s): 99901b09d0ae22

Merge branch 'main' of https://huggingface.co/spaces/praanjal/flowOs_v2

Browse files
Files changed (1) hide show
  1. README.md +5 -370
README.md CHANGED
@@ -1,375 +1,10 @@
1
  ---
2
- title: FlowOS-V2
3
- emoji: 🛠️
4
- colorFrom: blue
5
- colorTo: indigo
6
  sdk: docker
7
  pinned: false
8
- app_port: 7860
9
- base_path: /web
10
- tags:
11
- - developer-tools
12
- - pipeline-ops
13
- - llm-evaluation
14
- - workflow-generation
15
  ---
16
 
17
- # FlowOS
18
-
19
- FlowOS is an end-to-end benchmark for AI agents that operate like real production teams. Instead of testing a narrow coding trick, it evaluates whether one agent can handle the full operating loop around modern software systems: diagnose failures, review risky AI-generated changes, and ship new production artifacts safely.
20
-
21
- The benchmark runs inside a realistic repository with transforms, schemas, validators, lineage, deployment configs, policies, draft patches, and multi-file delivery tasks. That makes it useful for evaluating much more than “can the model write code?” It measures whether an agent can actually move work across the line.
22
-
23
- FlowOS is designed around the work that burns the most money in real teams:
24
-
25
- - failed pipelines, broken loads, and bad deploy drift that trigger retries, backfills, and missed refresh windows
26
- - risky AI-generated patches that increase reviewer burden or create downstream incidents
27
- - repetitive implementation work that bounces between developers, operators, analysts, and business owners before anything ships
28
-
29
- One benchmark covers repair, review, and implementation in the same environment. Instead of training or evaluating separate agents for incident response, patch review, and artifact generation, FlowOS measures whether a single agent can operate across the entire workflow.
30
-
31
- ## Why FlowOS
32
-
33
- Most agent benchmarks stop at chat help, log triage, or a single-file patch. FlowOS models the broader operating loop that real teams care about:
34
-
35
- - inspect the repo and supporting docs
36
- - understand contracts, dependencies, and operational constraints
37
- - decide whether an AI-generated fix is safe and correct
38
- - create or edit multiple artifacts across code, config, checks, and delivery metadata
39
- - validate before shipping
40
-
41
- That makes FlowOS useful well beyond a single developer persona. It is relevant anywhere business logic and production systems meet:
42
-
43
- - engineers repairing and shipping production changes
44
- - operators and platform teams responding to failures
45
- - analysts and data stakeholders who know the business logic but are not full-time software developers
46
- - domain experts who can describe the desired outcome in natural language and rely on the agent to assemble the right technical artifacts
47
-
48
- In other words, the benchmark measures whether an agent can turn intent into safe operational progress, not just whether it can autocomplete code.
49
-
50
- ## Why this saves money
51
-
52
- FlowOS is intentionally shaped around the highest-cost handoffs in production work:
53
-
54
- - catching bad fixes before deployment reduces failed runs, emergency rollbacks, and compute-heavy recovery work
55
- - repairing end-to-end loads and orchestration issues reduces backfill spend, on-call churn, and missed business reporting windows
56
- - rejecting unsafe or incorrect AI patches reduces reviewer load and downstream incident cost
57
- - generating production artifacts in the same environment reduces duplicated tooling across backend, platform, analytics, release, and operational workflows
58
-
59
- The deeper value is leverage. When one agent can repair, review, and implement inside the same system, teams spend less money on repeated handoffs between people who understand the business problem and people who know how to encode it technically.
60
-
61
- ## Benchmark design
62
-
63
- The benchmark is organized around **6 public task entries** and **3 internal objective families**:
64
-
65
- - public tasks are what evaluators select and score
66
- - scenarios are deterministic variants inside those tasks
67
- - internal grader families keep the implementation compact:
68
- - `repair`
69
- - `review`
70
- - `workflow`
71
- new
72
-
73
- Difficulty is defined at the **task level**:
74
-
75
- - Tasks `1-2` are easy
76
- - Tasks `3-4` are medium
77
- - Tasks `5-6` are hard
78
-
79
- Variation is defined at the **scenario level**:
80
-
81
- - each task contains one or more deterministic scenarios
82
- - same `task_id + scenario_index + seed` always yields the same scenario
83
- - selected scenarios also support light seeded literal variation in a few cases
84
- - same action trajectory always yields the same rewards and score
85
- - no randomness is used to create score spread
86
-
87
- ## Tasks
88
-
89
- | Task ID | Difficulty | Objective | Submission |
90
- |---|---|---|---|
91
- | `repair_data_transform` | Easy | Repair broken transform logic or dependency wiring while preserving downstream contracts | `submit_repair` |
92
- | `repair_pipeline_execution` | Easy | Repair ingestion and orchestration failures caused by path, runner, or deploy drift | `submit_repair` |
93
- | `review_ai_patch_safety` | Medium | Review AI-generated changes for privacy, governance, and operational safety risk | `submit_review` |
94
- | `review_ai_patch_correctness` | Medium | Review AI-generated changes for semantic correctness and contract compatibility | `submit_review` |
95
- | `synthesize_reporting_asset` | Hard | Create reporting-facing views, contracts, and alert/config assets | `submit_workspace` |
96
- | `synthesize_data_product` | Hard | Create production-grade marts and feature workflows with validation and governance | `submit_workspace` |
97
-
98
- ### Task coverage
99
-
100
- - `repair_data_transform`: schema drift and stale downstream dependency repairs
101
- - `repair_pipeline_execution`: ADLS path migration, Jenkins runner repair, deploy config drift, CSV/type mismatch loads, column-count mismatches, and primary-key-safe merge repair
102
- - `review_ai_patch_safety`: PII leakage and unsafe operational advice
103
- - `review_ai_patch_correctness`: incorrect joins and contract-breaking schema changes
104
- - `synthesize_reporting_asset`: reporting view delivery and reporting view + alert config delivery
105
- - `synthesize_data_product`: feature workflow and curated mart delivery
106
-
107
- ### Current scenario set
108
-
109
- - `repair_data_transform`
110
- - `PR-001`: schema drift in a warehouse transform
111
- - `PR-004`: stale downstream dependency on a deprecated upstream alias
112
- - `repair_pipeline_execution`
113
- - `PR-002`: ADLS path and partition migration
114
- - `PR-003`: Jenkins runner-path breakage
115
- - `PR-005`: deploy config env-var drift
116
- - `PR-006`: CSV identifier type mismatch during warehouse load
117
- - `PR-007`: 6-column extract into a 12-column archive target
118
- - `PR-008`: primary-key violation from duplicate dimension rows
119
- - `review_ai_patch_safety`
120
- - `LR-001`: PII leakage in an analytics patch
121
- - `LR-004`: unsafe warehouse recovery recommendation
122
- - `review_ai_patch_correctness`
123
- - `LR-002`: technically incorrect enrichment join
124
- - `LR-003`: published-contract-breaking rename
125
- - `synthesize_reporting_asset`
126
- - `WS-002`: reporting view + schema contract
127
- - `WS-004`: reporting view + alert config
128
- - `synthesize_data_product`
129
- - `WS-001`: feature workflow for downstream model scoring
130
- - `WS-003`: curated finance mart / data product
131
-
132
- ## Action space
133
-
134
- ```json
135
- {"action_type":"search_workspace","parameters":{"query":"orders_daily schema drift"}}
136
- {"action_type":"read_file","parameters":{"path":"transforms/orders_daily.sql"}}
137
- {"action_type":"inspect_schema","parameters":{"asset":"raw.orders_events"}}
138
- {"action_type":"inspect_lineage","parameters":{"asset":"risk_model_scoring"}}
139
- {"action_type":"inspect_llm_draft","parameters":{"draft_id":"primary"}}
140
- {"action_type":"edit_file","parameters":{"path":"sql/merchant_risk_features.sql","content":"..."}}
141
- {"action_type":"run_validator","parameters":{"validator":"governance_check"}}
142
- {"action_type":"submit_repair","parameters":{"root_cause":"schema rename event_ts -> event_time","fix_path":"transforms/orders_daily.sql","summary":"..."}}
143
- {"action_type":"submit_review","parameters":{"verdict":"reject","issue_type":"pii_exposure","summary":"..."}}
144
- {"action_type":"submit_workspace","parameters":{"summary":"..."}}
145
- ```
146
-
147
- ## Observation space
148
-
149
- The observation is typed in [models.py](/Users/pranjalparashar/Desktop/hackz/cw-apr1/control-room/developer_control_room/models.py) and includes:
150
-
151
- - `developer_request`
152
- - `workspace_summary`
153
- - `known_files`
154
- - `editable_targets`
155
- - `known_assets`
156
- - `available_validators`
157
- - `queried_data`
158
- - `edited_files`
159
- - `validator_status`
160
- - `cumulative_reward`
161
- - `feedback`
162
- - `last_action_error`
163
-
164
- The agent only sees operational context and its own interaction history. Hidden grader targets stay in the scenario fixtures and are not exposed directly in observations.
165
-
166
- ## Reward shaping
167
-
168
- Rewards are dense across the episode:
169
-
170
- - small positive reward for first-time useful investigation actions
171
- - negative reward for repeated, invalid, or no-op actions
172
- - a progress delta from the deterministic grader after each step
173
- - additional signal when validators are run and begin passing
174
- - late-episode and max-step penalties for inefficient trajectories
175
-
176
- This means the agent gets feedback for real progress, not just a binary terminal signal.
177
-
178
- ## Deterministic graders
179
-
180
- Each task has a deterministic grader implemented in [graders.py](/Users/pranjalparashar/Desktop/hackz/cw-apr1/control-room/developer_control_room/graders.py):
181
-
182
- - `repair`: investigation + correct file edit + validator passes + root-cause submission
183
- - `review`: investigation + verdict + issue type + summary evidence
184
- - `workflow`: reference inspection + artifact quality + governance + validator passes + summary
185
-
186
- The public task list contains 6 tasks, but these 6 tasks intentionally map to 3 internal grader families because there are only 3 objective types. All task scores are constrained to `0.0–1.0`.
187
-
188
- ## Anti-gaming and reproducibility
189
-
190
- The environment is designed so that reward comes from useful work, not cheap action farming:
191
-
192
- - repeated reads and repeated validators degrade in reward
193
- - invalid or poorly grounded actions lose reward
194
- - hard tasks intentionally require more investigation and broader validator coverage
195
- - same task, scenario, and action trajectory always produce the same score
196
-
197
- The repo now includes explicit tests for:
198
-
199
- - repeated validator spam
200
- - repeated file reads
201
- - invalid early edits in the hybrid baseline
202
- - reset-state cleanliness
203
- - deterministic replay scoring
204
- - solved versus unsolved hard-scenario separation
205
-
206
- ### Score and success semantics
207
-
208
- - `score` is a normalized quality signal in `0.0–1.0`
209
- - `success` is not a simple threshold; it reflects whether the scenario’s core solve criteria were met
210
- - this allows a scenario to score highly without being marked fully solved, especially in the hard tasks
211
-
212
- ### Intended calibration
213
-
214
- - easy tasks should cluster highest
215
- - medium tasks should cluster below easy
216
- - hard tasks should cluster lowest on average
217
- - hard tasks intentionally mix solved and partial scenarios
218
-
219
- Latest all-scenario baseline run:
220
-
221
- | Public task | Typical band |
222
- |---|---|
223
- | `repair_data_transform` | `0.88-0.98` |
224
- | `repair_pipeline_execution` | `0.90-0.97` |
225
- | `review_ai_patch_safety` | `0.82-0.86` |
226
- | `review_ai_patch_correctness` | `0.78-0.83` |
227
- | `synthesize_reporting_asset` | `0.65-0.71` |
228
- | `synthesize_data_product` | `0.61-0.70` |
229
-
230
- Overall, the current calibrated profile is:
231
-
232
- - easy tasks: about `0.93-0.95`
233
- - medium tasks: about `0.82-0.84`
234
- - hard tasks: about `0.65-0.68`
235
-
236
- ## Baseline inference
237
-
238
- The root [inference.py](/Users/pranjalparashar/Desktop/hackz/cw-apr1/control-room/developer_control_room/inference.py) is the submission-facing entrypoint. It uses the OpenAI client with:
239
-
240
- - `API_BASE_URL`
241
- - `MODEL_NAME`
242
- - `API_KEY`
243
-
244
- The benchmark-specific helper logic lives in [baseline.py](/Users/pranjalparashar/Desktop/hackz/cw-apr1/control-room/developer_control_room/baseline.py):
245
-
246
- - prompt construction
247
- - model response parsing
248
- - deterministic fallback policy
249
- - baseline artifact templates
250
- - grader fetch helpers
251
-
252
- By default, the baseline is a bounded hybrid policy: it allows `2` model-led steps, then switches to deterministic fallback behavior for the rest of the episode. You can change that budget with `DEVELOPER_CONTROL_ROOM_MAX_MODEL_STEPS` if you want a more or less model-led baseline for local experiments.
253
-
254
- The baseline also supports two optional experimental knobs for local research:
255
-
256
- - light seeded scenario variation through `DEVELOPER_CONTROL_ROOM_SCENARIO_SEED`
257
- - cross-episode baseline memory through `DEVELOPER_CONTROL_ROOM_ENABLE_EPISODE_MEMORY=true`
258
-
259
- That memory is policy-side only: it writes compact episode summaries to a temp JSON file and reuses them in later prompts, but it does not change environment state, reset behavior, or grading.
260
-
261
- ### Inference behavior
262
-
263
- - `python inference.py` runs all 6 public tasks by default
264
- - `DEVELOPER_CONTROL_ROOM_TASK=<task_id> python inference.py` runs one task
265
- - `DEVELOPER_CONTROL_ROOM_RUN_ALL_SCENARIOS=true python inference.py` runs every scenario inside every selected task
266
- - `DEVELOPER_CONTROL_ROOM_SCENARIO_INDEX=<n>` selects a specific scenario index inside each selected task
267
- - `DEVELOPER_CONTROL_ROOM_SCENARIO_SEED=<n>` selects scenarios deterministically by seed
268
-
269
- Example:
270
-
271
- ```bash
272
- DEVELOPER_CONTROL_ROOM_RUN_ALL_SCENARIOS=true python inference.py
273
- ```
274
-
275
- ## Local usage
276
-
277
- ```bash
278
- uv sync
279
- uv run server
280
- ```
281
-
282
- Or with Docker:
283
-
284
- ```bash
285
- docker build -t developer-control-room-env .
286
- docker run -p 7860:7860 developer-control-room-env
287
- ```
288
-
289
- Example local container run:
290
-
291
- ```bash
292
- docker build -t developer_control_room:latest .
293
- docker stop developer_control_room 2>/dev/null
294
- docker rm developer_control_room 2>/dev/null
295
- docker run -d --name developer_control_room -p 7860:7860 developer_control_room:latest
296
- python inference.py
297
- ```
298
-
299
- ## Training
300
-
301
- FlowOS now includes a minimal Colab-friendly GRPO training path built on HF TRL. This path is intentionally lightweight: it trains directly against the existing OpenEnv environment and uses the environment's own dense rewards and terminal scores.
302
-
303
- ### Install training dependencies
304
-
305
- ```bash
306
- pip install -e ".[train]"
307
- ```
308
-
309
- ### Start the environment server
310
-
311
- ```bash
312
- uv run server
313
- ```
314
-
315
- ### Run a small GRPO training job
316
-
317
- ```bash
318
- python train.py \
319
- --env-url http://localhost:7860 \
320
- --model-id Qwen/Qwen2.5-1.5B-Instruct \
321
- --dataset-size 24 \
322
- --num-generations 4 \
323
- --task-scope all \
324
- --report-to none
325
- ```
326
-
327
- This creates LoRA checkpoints plus a CSV reward log under `outputs/`.
328
-
329
- ### Compare base vs tuned policy
330
-
331
- ```bash
332
- python eval.py \
333
- --env-url http://localhost:7860 \
334
- --model-id Qwen/Qwen2.5-1.5B-Instruct \
335
- --checkpoint-path outputs/<run-dir>
336
- ```
337
-
338
- `eval.py` prints a compact table with:
339
-
340
- - average episode reward
341
- - average grader score
342
- - solved rate
343
- - average steps used
344
-
345
- For judging, the most useful artifact to screenshot is the before/after eval table together with the reward log produced during training.
346
-
347
- ## Validation
348
-
349
- The benchmark has also been validated against the submission-style checks:
350
-
351
- - the deployed environment responds to `/reset`
352
- - Docker build succeeds
353
- - `inference.py` emits the required `[START]`, `[STEP]`, and `[END]` lines
354
-
355
- ## Project structure
356
-
357
- ```text
358
- developer_control_room/
359
- ├── Dockerfile
360
- ├── README.md
361
- ├── openenv.yaml
362
- ├── pyproject.toml
363
- ├── inference.py
364
- ├── train.py
365
- ├── eval.py
366
- ├── baseline.py
367
- ├── tasks.py
368
- ├── graders.py
369
- ├── models.py
370
- ├── client.py
371
- ├── training_utils.py
372
- └── server/
373
- ├── app.py
374
- └── developer_control_room_environment.py
375
- ```
 
1
  ---
2
+ title: FlowOs V2
3
+ emoji: 📚
4
+ colorFrom: red
5
+ colorTo: green
6
  sdk: docker
7
  pinned: false
 
 
 
 
 
 
 
8
  ---
9
 
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference