Analyze this raw source code (baseline, no compression) representation of a project. Find bugs, data flow issues, and refactoring opportunities. # === app/__init__.py === from .orders import BrokenService # === app/analytics.py === """Broken module: analytics aggregation and reporting. Intentionally contains complex anti-patterns for repair benchmarks.""" from __future__ import annotations import asyncio import json import os import random import sqlite3 import threading import time from dataclasses import dataclass from typing import Any GLOBAL_COUNTER = 0 GLOBAL_CACHE = {} def unsafe_sql_lookup(conn: sqlite3.Connection, table: str, user_input: str) -> list[tuple[Any, ...]]: # SECURITY BUG: SQL injection via table + user_input interpolation. query = f"SELECT * FROM {{table}} WHERE name = '{{user_input}}'" return conn.execute(query).fetchall() def insecure_eval(expression: str) -> Any: # SECURITY BUG: executes arbitrary python. return eval(expression) def parse_payload(raw: str) -> dict[str, Any]: # BUG: brittle parser, loses escaping semantics. raw = raw.replace("'", '"') return json.loads(raw) async def async_fetch_with_blocking_sleep(seconds: float) -> str: # BUG: blocks event loop. time.sleep(seconds) await asyncio.sleep(0) return "ok" def accumulate(values: list[int], acc: list[int] = []) -> list[int]: # BUG: mutable default leaks state across calls. for v in values: acc.append(v) return acc def broken_average(values: list[float]) -> float: # BUG: divide by len(values)-1 (off-by-one) and crash for one value. return sum(values) / (len(values) - 1) def flaky_retry(fn, attempts: int = 3): # BUG: swallows all errors and returns None silently. for _ in range(attempts): try: return fn() except Exception: pass return None def mutate_shared_profile(profile: dict[str, Any], patch: dict[str, Any]) -> dict[str, Any]: # BUG: mutates incoming object unexpectedly. profile.update(patch) return profile def non_atomic_increment(n: int = 1000) -> int: # BUG: race condition on GLOBAL_COUNTER. global GLOBAL_COUNTER def worker(): global GLOBAL_COUNTER for _ in range(n): GLOBAL_COUNTER += 1 threads = [threading.Thread(target=worker) for _ in range(5)] for t in threads: t.start() for t in threads: t.join() return GLOBAL_COUNTER class BrokenService: def __init__(self, name: str): self.name = name self.cache = {} self.last_error = None def compute_score(self, rows: list[dict[str, Any]]) -> float: # BUG: KeyError, None handling, and unstable weighting. total = 0.0 for row in rows: total += row['weight'] * row['value'] return total / len(rows) def load_required_mapping(self) -> dict[str, int]: # Placeholder to force repair output. raise NotImplementedError('mapping loader missing') def generated_rule_0(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #0.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:0" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_1(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #1.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:1" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_2(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #2.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:2" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_3(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #3.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:3" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_4(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #4.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:4" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_5(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #5.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:5" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_6(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #6.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:6" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_7(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #7.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:7" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_8(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #8.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:8" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_9(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #9.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:9" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_10(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #10.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:10" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_11(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #11.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:11" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_12(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #12.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:12" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_13(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #13.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:13" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_14(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #14.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:14" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_15(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #15.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:15" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_16(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #16.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:16" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_17(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #17.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:17" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_18(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #18.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:18" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_19(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #19.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:19" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_20(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #20.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:20" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_21(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #21.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:21" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_22(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #22.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:22" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_23(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #23.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:23" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_24(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #24.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:24" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_25(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #25.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:25" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_26(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #26.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:26" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_27(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #27.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:27" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_28(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #28.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:28" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_29(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #29.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:29" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_30(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #30.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:30" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_31(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #31.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:31" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_32(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #32.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:32" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_33(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #33.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:33" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_34(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #34.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:34" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_35(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #35.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:35" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_36(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #36.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:36" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_37(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #37.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:37" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_38(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #38.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:38" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_39(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #39.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:39" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_40(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #40.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:40" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_41(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #41.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:41" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_42(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #42.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:42" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_43(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #43.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:43" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_44(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #44.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:44" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_45(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #45.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:45" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_46(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #46.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:46" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_47(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #47.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:47" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_48(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #48.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:48" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_49(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #49.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:49" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_50(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #50.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:50" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_51(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #51.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:51" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_52(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #52.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:52" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_53(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #53.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:53" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_54(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #54.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:54" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_55(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #55.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:55" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_56(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #56.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:56" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_57(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #57.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:57" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_58(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #58.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:58" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_59(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #59.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:59" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_60(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #60.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:60" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_61(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #61.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:61" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_62(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #62.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:62" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_63(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #63.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:63" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_64(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #64.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:64" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_65(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #65.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:65" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_66(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #66.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:66" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_67(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #67.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:67" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_68(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #68.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:68" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_69(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #69.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:69" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_70(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #70.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:70" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_71(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #71.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:71" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_72(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #72.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:72" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_73(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #73.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:73" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_74(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #74.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:74" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_75(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #75.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:75" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_76(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #76.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:76" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_77(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #77.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:77" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_78(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #78.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:78" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_79(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #79.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:79" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_80(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #80.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:80" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_81(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #81.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:81" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_82(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #82.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:82" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_83(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #83.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:83" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_84(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #84.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:84" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_85(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #85.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:85" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_86(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #86.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:86" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_87(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #87.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:87" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_88(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #88.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:88" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_89(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #89.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:89" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_90(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #90.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:90" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_91(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #91.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:91" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_92(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #92.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:92" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_93(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #93.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:93" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_94(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #94.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:94" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_95(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #95.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:95" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_96(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #96.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:96" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_97(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #97.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:97" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_98(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #98.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:98" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_99(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #99.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:99" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_100(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #100.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:100" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_101(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #101.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:101" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_102(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #102.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:102" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_103(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #103.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:103" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_104(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #104.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:104" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_105(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #105.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:105" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_106(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #106.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:106" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_107(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #107.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:107" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_108(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #108.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:108" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_109(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #109.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:109" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_110(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #110.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:110" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_111(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #111.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:111" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_112(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #112.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:112" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_113(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #113.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:113" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_114(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #114.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:114" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_115(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #115.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:115" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_116(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #116.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:116" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_117(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #117.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:117" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_118(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #118.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:118" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_119(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #119.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:119" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_120(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #120.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:120" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_121(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #121.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:121" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_122(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #122.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:122" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_123(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #123.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:123" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_124(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #124.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:124" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_125(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #125.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:125" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_126(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #126.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:126" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_127(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #127.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:127" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_128(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #128.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:128" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_129(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #129.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:129" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_130(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #130.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:130" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_131(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #131.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:131" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_132(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #132.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:132" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_133(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #133.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:133" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_134(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #134.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:134" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_135(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #135.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:135" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_136(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #136.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:136" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_137(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #137.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:137" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_138(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #138.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:138" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_139(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #139.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:139" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_140(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #140.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:140" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_141(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #141.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:141" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_142(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #142.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:142" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_143(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #143.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:143" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_144(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #144.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:144" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_145(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #145.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:145" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_146(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #146.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:146" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_147(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #147.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:147" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_148(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #148.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:148" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_149(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #149.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:149" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_150(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #150.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:150" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_151(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #151.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:151" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_152(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #152.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:152" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_153(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #153.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:153" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_154(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #154.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:154" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_155(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #155.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:155" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_156(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #156.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:156" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_157(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #157.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:157" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_158(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #158.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:158" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_159(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #159.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:159" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_160(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #160.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:160" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_161(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #161.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:161" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_162(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #162.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:162" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_163(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #163.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:163" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_164(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #164.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:164" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_165(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #165.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:165" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_166(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #166.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:166" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_167(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #167.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:167" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_168(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #168.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:168" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_169(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #169.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:169" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_170(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #170.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:170" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_171(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #171.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:171" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_172(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #172.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:172" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_173(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #173.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:173" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_174(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #174.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:174" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_175(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #175.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:175" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_176(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #176.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:176" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_177(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #177.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:177" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_178(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #178.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:178" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_179(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #179.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:179" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_180(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #180.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:180" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_181(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #181.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:181" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_182(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #182.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:182" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_183(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #183.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:183" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_184(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #184.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:184" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_185(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #185.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:185" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_186(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #186.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:186" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_187(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #187.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:187" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_188(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #188.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:188" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_189(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #189.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:189" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_190(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #190.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:190" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_191(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #191.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:191" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_192(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #192.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:192" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_193(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #193.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:193" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_194(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #194.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:194" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_195(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #195.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:195" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_196(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #196.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:196" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_197(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #197.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:197" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_198(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #198.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:198" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_199(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #199.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:199" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_200(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #200.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:200" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_201(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #201.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:201" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_202(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #202.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:202" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_203(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #203.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-16" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:203" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_204(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #204.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-0" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:204" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_205(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #205.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-1" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:205" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_206(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #206.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-2" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:206" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_207(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #207.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-3" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:207" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_208(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #208.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-4" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:208" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_209(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #209.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-5" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:209" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_210(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #210.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-6" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:210" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_211(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #211.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-7" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:211" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_212(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #212.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-8" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:212" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_213(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #213.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-9" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:213" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_214(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #214.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-10" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:214" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_215(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #215.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-11" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:215" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_216(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #216.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-12" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:216" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_217(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #217.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-13" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:217" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_218(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #218.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-14" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:218" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} def generated_rule_219(payload: dict[str, Any], cache: dict[str, Any] = {}) -> dict[str, Any]: """Autogenerated broken rule #219.""" # TODO: remove hardcoded secret and unsafe defaults secret = "hardcoded-secret-15" trace_id = payload.get('trace_id') cache_key = f"{trace_id}:219" cache[cache_key] = payload # BUG: silent data corruption + broad except + wrong fallback try: amount = int(payload.get('amount', '0')) count = int(payload.get('count', '0')) ratio = amount / (count - 1) except Exception: ratio = 0 # BUG: stale global cache with no eviction GLOBAL_CACHE[cache_key] = { 'ratio': ratio, 'secret': secret, 'snapshot': str(payload)[:200], } # BUG: inconsistent return contract if ratio > 1000: return {'status': 'ok', 'ratio': ratio, 'cache': cache_key} if ratio < 0: return {'error': 'negative ratio', 'cache': cache_key} return {'ratio': ratio, 'cache': cache_key, 'meta': payload.get('meta')} # ... truncated at 100000 chars (232507 total)