Skip to content

stack-bench: team-chat cross-backend agentic benchmark - #5665

Open
cloutiertyler wants to merge 1 commit into
masterfrom
stack-bench-team-chat
Open

stack-bench: team-chat cross-backend agentic benchmark#5665
cloutiertyler wants to merge 1 commit into
masterfrom
stack-bench-team-chat

Conversation

@cloutiertyler

Copy link
Copy Markdown
Contributor

Summary

Adds team-chat, the main stack-bench task: a cross-backend agentic benchmark where an AI coding agent must build a full team-chat backend (rooms/owners/membership with permissions, presence, server-maintained unread counters, message edit + tombstone delete, idempotent sends, per-room gapless sequence numbers under concurrency, atomic credit tips), graded purely behaviorally through each backend's real client SDK.

Built in Harbor format (the Terminal-Bench 2.0 harness): fixed prompts (instruction.md), Dockerized environments, oracle solutions, machine verification. This is separate from the one-shot model leaderboard in tools/xtask-llm-benchmark/ — stack-bench fixes the agent+model and varies the backend.

Verifier

One backend-neutral TypeScript scenario (_shared/harness/src/teamChat/) against an AppClient contract; per-backend adapters (~200 lines each). 46 checks in 4 weighted metric groups, emitted as reward.txt + multi-metric reward.json + per-check result.json (the feedback payload for multi-step agent loops):

  • correctness 0.40 — validation/permission edges, idempotent resends, gapless seq with 3 concurrent writers, exact unread counters (multi-row atomicity), tip conservation under concurrent transfers, monotone mark-read, tombstone privacy, τ-bench-style full goal-state comparison
  • realtime 0.30 — exactly-once in-order fan-out to 3 subscribers, server-side cross-room isolation, late-joiner history-then-live with no boundary dupes/gaps, live propagation of edits/deletes/presence/membership/balances
  • durability 0.20 — Jepsen-style backend process kill + restart mid-scenario via each environment's /opt/stack-bench/backendctl restart; all state must survive, seq counters must continue exactly, dedupe records must persist
  • perf 0.10 — delivery latency p95 + 120-message concurrent burst; raw p50/p95/throughput always reported

Both environments are single-container (SpacetimeDB: rust:1.93 + CLI; Convex: the official convex-backend image with Node added), so the backend shares the agent's resource budget and process-level restart works uniformly.

Validation

Oracle reward 1.000 through Harbor on both backends (46/46 checks, 0 exceptions):

SpacetimeDB Convex
Oracle reward 1.0000 1.0000
p50 / p95 latency 4ms / 7ms 18ms / 27ms
Burst throughput 952 msg/s ~90 msg/s

Also in this PR

  • xtask reworked for the tasks/<task>/<backend> layout (--task flag, default team-chat); cargo stack-bench alias + workspace member wired up
  • The original realtime-chat spike kept as a smoke test

Usage

cargo stack-bench list
cargo stack-bench oracle spacetimedb        # harness self-test, expect 1.0
cargo stack-bench agent convex --model anthropic/claude-fable-5
cargo stack-bench all --agent claude-code --model ...   # comparison table

Next steps

Real-agent runs (needs ANTHROPIC_API_KEY / CLAUDE_CODE_OAUTH_TOKEN), pass^k trials via -- -k N, effort metrics in the comparison table, more backends (Postgres, Mongo, Supabase, Firebase), pre-baked deps for hermeticity.

Add the full team-chat benchmark task to stack-bench (Harbor format):
rooms/membership/permissions, presence, server-maintained unread counters,
edit + tombstone delete, idempotent sends, per-room gapless seq under
concurrency, atomic credit tips. 46 behavioral checks in 4 weighted metric
groups (correctness .40 / realtime .30 / durability .20 / perf .10),
including a Jepsen-style mid-scenario backend kill/restart via each
environment's backendctl. Harness emits reward.txt, multi-metric
reward.json, and per-check result.json (agent feedback payload).

Oracle reward 1.000 through Harbor on both spacetimedb and convex
(46/46 checks, 0 exceptions). Both environments are single-container so
the backend shares the agent's resource budget and process-level restart
works uniformly.

Also: rework xtask for the tasks/<task>/<backend> layout, wire the
cargo stack-bench alias + workspace member, and keep the realtime-chat
spike as a smoke test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant