Update README.md
Browse files37 unmodified lines38394041424344454647484950515253545556575859606162636465666768697071727374757677787937 unmodified lines- `POST /mcp` – minimal MCP endpoint## TasksEasy (null‑checks, simple logic errors)# Bug ID Description How to inject1 null_check Missing if key in dict: guard AST: remove if‑statement2 simple_typo Variable name misspelled (users → usres) AST: rename variable3 string_index Indexing string with wrong index (off‑by‑one) AST: change constant in index4 default_value Not providing a default in dict.get() AST: replace dict[key] with dict.get(key) … but wrongly5 empty_return Function returns None in a branch that should return something AST: insert return None or delete a returnMedium (off‑by‑one, loop logic, simple arithmetic)# Bug ID Description How to inject6 off_by_one range(x) → range(1, x-1) (skips first and last) AST: modify range args7 loop_skip for i in range(len(arr)): missing last element because of off‑by‑one AST: change range length8 sign_error sum += item replaced with sum -= item AST: swap Add/Sub9 swap_args Calling a function with arguments swapped AST: swap arg order10 uninitialised_var Using a variable before assignment in a loop AST: remove assignment lineHard (division‑by‑zero, floating‑point, edge‑case handling)# Bug ID Description How to inject11 division_by_zero_empty Missing check for empty list before averaging AST: remove the if not data: guard12 division_by_zero_zero Integer division where denominator can be zero AST: remove a denominator‑checking statement13 float_precision Using integer division // instead of / for average AST: change operator14 abs_usage Forgetting abs() when comparing differences AST: remove abs() call15 round_error Rounding too early causing precision loss AST: insert round() incorrectlyHarder (race conditions, missing atomic operations)# Bug ID Description How to inject16 missing_lock Shared counter accessed without a lock Template: remove with lock: from code17 double_lock Acquiring the same lock twice (deadlock risk) Template: add extra lock.acquire()18 global_nonatomic Compound assignment x = x + 1 instead of atomic += AST: modify assignment node19 thread_safe_list Appending to a list from multiple threads without lock Template: remove lock around list operation20 volatile_read Reading a shared flag outside a lock Template: remove synchronization blockHardest (deadlock, ordering, complex concurrency)# Bug ID Description How to inject21 deadlock_order Lock A then lock B in one thread, opposite in another Template: swap lock acquisition order22 nested_lock_timeout Not using a timeout when acquiring locks, causing hang Template: replace acquire() with acquire(blocking=True) without timeout23 fork_join Starting threads and not waiting for them to finish (missing join()) AST: remove thread.join()24 mutex_release Releasing a mutex in one thread that was locked by another Template: wrong release logic25 race_on_init Initializing a shared resource after threads have started Template: move initialization after thread creation## Deployment```bash37 unmodified lines38394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969737 unmodified lines- `POST /mcp` – minimal MCP endpoint## Tasks## 🐛 Bug Taxonomy (25 bugs across 5 difficulty levels)The **RedTeam** randomly selects one bug from the current difficulty level at the start of every episode.Your agent must figure out what’s broken, gather evidence, and convince the simulated author – or it won’t stick.### 🟢 Easy – Null‑Checks & Simple Logic Errors| # | Bug ID | What’s wrong | Injection method ||---|--------|--------------|------------------|| 1 | `null_check` | Missing `if key in dict:` guard → KeyError | AST: remove the if‑statement || 2 | `simple_typo` | Misspelled variable `users` → `usres` | AST: rename variable || 3 | `string_index` | String index shifted by +1 | AST: change constant in index || 4 | `default_value` | `dict.get(key)` used without a fallback | AST: replace `dict.get(key)` with `dict[key]` || 5 | `empty_return` | Function returns `None` prematurely | AST: insert `return None` early |### 🟡 Medium – Off‑By‑One, Loop Logic & Simple Arithmetic| # | Bug ID | What’s wrong | Injection method ||---|--------|--------------|------------------|| 6 | `off_by_one` | `range(x)` becomes `range(1, x-1)` – skips first & last | AST: modify range arguments || 7 | `loop_skip` | `range(len(arr))` becomes `range(len(arr)-1)` – misses last element | AST: change range length || 8 | `sign_error` | `sum += item` turned into `sum -= item` | AST: swap Add / Sub || 9 | `swap_args` | Function arguments swapped | AST: swap first two arguments ||10 | `uninitialised_var` | Variable used before assignment in a loop | AST: remove the assignment statement |### 🟠 Hard – Division‑By‑Zero, Floating‑Point & Edge Cases| # | Bug ID | What’s wrong | Injection method ||---|--------|--------------|------------------||11 | `division_by_zero_empty` | Empty‑list guard removed before averaging | AST: delete `if not data:` ||12 | `division_by_zero_zero` | Denominator check removed | AST: remove the zero‑check ||13 | `float_precision` | True division `/` replaced by integer division `//` | AST: change Div → FloorDiv ||14 | `abs_usage` | `abs()` call removed when comparing differences | AST: delete `abs()` wrapper ||15 | `round_error` | `round()` placed too early, causing precision drift | AST: inject `round()` prematurely |### 🔴 Harder – Race Conditions & Atomicity Bugs| # | Bug ID | What’s wrong | Injection method ||---|--------|--------------|------------------||16 | `missing_lock` | Shared counter incremented without a lock | Template: remove `with lock:` ||17 | `double_lock` | Acquiring the same lock twice → deadlock risk | Template: add extra `lock.acquire()` ||18 | `global_nonatomic` | `count = count + 1` (read‑modify‑write) instead of `+=` | AST: modify assignment node ||19 | `thread_safe_list` | List append across threads without synchronisation | Template: remove lock from list operation ||20 | `volatile_read` | Shared flag read outside a lock → stale value | Template: remove synchronisation block |### ⚫ Hardest – Deadlocks, Ordering & Complex Concurrency| # | Bug ID | What’s wrong | Injection method ||---|--------|--------------|------------------||21 | `deadlock_order` | Locks acquired in opposite order in two threads | Template: swap lock order ||22 | `nested_lock_timeout` | `lock.acquire()` without a timeout → permanent hang | Template: remove timeout logic ||23 | `fork_join` | Thread started but not joined (`join()` missing) | AST: remove `thread.join()` ||24 | `mutex_release` | Lock released by a thread that never acquired it | Template: incorrect release logic ||25 | `race_on_init` | Shared resource initialised after threads have started | Template: move initialisation after `join()` |## Deployment```bash
README.md+53-35