Skip to content

Commit 5815d7b

Browse files
committed
benchmark: add AIEB v1.0 agent intelligence benchmark
9 tasks across 3 tiers (reasoning, search, code generation). Automated scoring with keyword matching, LOC verification, and runtime import/execution tests. First run: odek + deepseek-v4-flash = 90% score, 199s, 208K tokens. Usage: python3 benchmark/run_aieb.py
1 parent b6ae4b0 commit 5815d7b

23 files changed

Lines changed: 1492 additions & 0 deletions
29.3 KB
Binary file not shown.

benchmark/aieb.py

Lines changed: 553 additions & 0 deletions
Large diffs are not rendered by default.
2.58 KB
Binary file not shown.
Binary file not shown.

benchmark/benchmark_data/arch_project/__init__.py

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Chain of Responsibility base."""
2+
from abc import ABC, abstractmethod
3+
from typing import Any
4+
5+
class BaseHandler(ABC):
6+
def __init__(self): self._next: BaseHandler | None = None
7+
def set_next(self, h: "BaseHandler") -> "BaseHandler": self._next = h; return h
8+
@abstractmethod
9+
def handle(self, r: dict[str, Any]) -> dict[str, Any] | None: ...
10+
def _pass(self, r: dict[str, Any]) -> dict[str, Any] | None:
11+
return self._next.handle(r) if self._next else None
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Concrete handlers."""
2+
from typing import Any
3+
from .base import BaseHandler
4+
5+
class AuthHandler(BaseHandler):
6+
def handle(self, r: dict[str, Any]) -> dict[str, Any] | None:
7+
if r.get("auth") == "valid": r["authenticated"] = True; return self._pass(r)
8+
return {"error": "unauthorized"}
9+
10+
class RateLimitHandler(BaseHandler):
11+
def __init__(self, max_rps=100): super().__init__(); self.max_rps = max_rps
12+
def handle(self, r: dict[str, Any]) -> dict[str, Any] | None:
13+
return self._pass(r) if r.get("rate",0) <= self.max_rps else {"error":"rate_limited"}
14+
15+
class BusinessLogicHandler(BaseHandler):
16+
def handle(self, r: dict[str, Any]) -> dict[str, Any] | None:
17+
return self._pass(r) or {"status":"processed","data":r}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Pipeline builder."""
2+
from .handlers import AuthHandler, RateLimitHandler, BusinessLogicHandler
3+
4+
def build_pipeline(max_rps=100):
5+
a = AuthHandler(); r = RateLimitHandler(max_rps); l = BusinessLogicHandler()
6+
a.set_next(r).set_next(l)
7+
return a

benchmark/benchmark_data/buggy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""User authentication — CONTAINS A BUG."""
2+
def authenticate(username: str, password: str, user_db: dict) -> bool:
3+
if not username or not password:
4+
return False
5+
user = user_db.get(username)
6+
if user is None:
7+
return False
8+
if user["active"] = False: # BUG: assignment, not comparison
9+
return False
10+
if user["password"] != password:
11+
return False
12+
return True
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""Event processing utilities."""
2+
from collections import defaultdict
3+
from datetime import datetime
4+
from typing import Any
5+
6+
def process_events(events: list[dict[str, Any]], window_seconds: int = 300) -> list[dict[str, Any]]:
7+
"""Process a list of timestamped events."""
8+
if not events:
9+
return []
10+
seen: set[str] = set()
11+
unique: list[dict[str, Any]] = []
12+
for evt in events:
13+
eid = evt.get("id", "")
14+
if eid and eid not in seen:
15+
seen.add(eid)
16+
unique.append(evt)
17+
unique.sort(key=lambda e: e.get("ts", datetime.min))
18+
windows: dict[str, list[dict[str, Any]]] = defaultdict(list)
19+
for evt in unique:
20+
ts = evt.get("ts")
21+
if ts is None:
22+
continue
23+
bucket = ts.replace(second=0, microsecond=0)
24+
windows[bucket.isoformat()].append(evt)
25+
result: list[dict[str, Any]] = []
26+
for window_key, bucket in sorted(windows.items()):
27+
result.append({
28+
"window": window_key, "count": len(bucket),
29+
"types": list({e.get("type", "unknown") for e in bucket}),
30+
"earliest": min(e["ts"] for e in bucket).isoformat(),
31+
"latest": max(e["ts"] for e in bucket).isoformat(),
32+
})
33+
return result

0 commit comments

Comments
 (0)