From ca33ce2f709a097740dc57f74b160784bd6ee955 Mon Sep 17 00:00:00 2001 From: Aditya Chhabra Date: Fri, 13 Mar 2026 07:17:47 +0530 Subject: [PATCH] feat: v3 simulation action configs and improved multi-file extraction Add 5 action YAML configs for v3 simulation stress tests (todo-cli, bookstore-api, websocket-chat, hn-scraper, flask-auth). Update multi-file markdown extraction regex to also match bold-only headers (**filename.py**) without requiring # prefix. --- actions/sim1-todo-cli.yaml | 11 +++++++++++ actions/sim2-bookstore-api.yaml | 13 +++++++++++++ actions/sim3-websocket-chat.yaml | 12 ++++++++++++ actions/sim4-hn-scraper.yaml | 12 ++++++++++++ actions/sim5-flask-auth.yaml | 12 ++++++++++++ src/cleveragents/agents/graphs/plan_generation.py | 12 +++++------- 6 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 actions/sim1-todo-cli.yaml create mode 100644 actions/sim2-bookstore-api.yaml create mode 100644 actions/sim3-websocket-chat.yaml create mode 100644 actions/sim4-hn-scraper.yaml create mode 100644 actions/sim5-flask-auth.yaml diff --git a/actions/sim1-todo-cli.yaml b/actions/sim1-todo-cli.yaml new file mode 100644 index 00000000..1578ea78 --- /dev/null +++ b/actions/sim1-todo-cli.yaml @@ -0,0 +1,11 @@ +name: local/todo-cli +description: > + Build a command-line TODO application in Python with add, list, complete, + and delete commands. Store tasks in a JSON file. Include a Task dataclass + with id, title, completed, and created_at fields. +strategy_actor: anthropic/claude-sonnet-4-20250514 +execution_actor: anthropic/claude-sonnet-4-20250514 +definition_of_done: > + A todo.py file exists with CLI commands for add, list, complete, and delete. + Tasks are persisted in a tasks.json file. A Task dataclass has id, title, + completed, and created_at fields. diff --git a/actions/sim2-bookstore-api.yaml b/actions/sim2-bookstore-api.yaml new file mode 100644 index 00000000..af03ae1a --- /dev/null +++ b/actions/sim2-bookstore-api.yaml @@ -0,0 +1,13 @@ +name: local/bookstore-api +description: > + Build a REST API for a bookstore using FastAPI. Include endpoints for + CRUD operations on books (GET /books, GET /books/{id}, POST /books, + PUT /books/{id}, DELETE /books/{id}). Use Pydantic models for Book + with fields: id, title, author, price, isbn. Store books in memory. + Include requirements.txt. +strategy_actor: anthropic/claude-sonnet-4-20250514 +execution_actor: anthropic/claude-sonnet-4-20250514 +definition_of_done: > + A main.py with FastAPI app has all CRUD endpoints for books. + A Book Pydantic model has id, title, author, price, isbn fields. + A requirements.txt lists dependencies. diff --git a/actions/sim3-websocket-chat.yaml b/actions/sim3-websocket-chat.yaml new file mode 100644 index 00000000..6f7c76c7 --- /dev/null +++ b/actions/sim3-websocket-chat.yaml @@ -0,0 +1,12 @@ +name: local/websocket-chat +description: > + Build a WebSocket chat server in Python using the websockets library. + Support multiple connected clients, broadcast messages to all clients, + handle connect/disconnect events, and include a simple HTML client page. + Include requirements.txt. +strategy_actor: anthropic/claude-sonnet-4-20250514 +execution_actor: anthropic/claude-sonnet-4-20250514 +definition_of_done: > + A server.py implements a WebSocket chat server with broadcast support. + An index.html provides a browser-based chat client. + A requirements.txt lists dependencies. diff --git a/actions/sim4-hn-scraper.yaml b/actions/sim4-hn-scraper.yaml new file mode 100644 index 00000000..fd4f75a7 --- /dev/null +++ b/actions/sim4-hn-scraper.yaml @@ -0,0 +1,12 @@ +name: local/hn-scraper +description: > + Build a Hacker News scraper in Python using requests and BeautifulSoup. + Scrape the front page for top stories including title, URL, points, and + comment count. Output results as JSON. Include a Story dataclass and + requirements.txt. +strategy_actor: anthropic/claude-sonnet-4-20250514 +execution_actor: anthropic/claude-sonnet-4-20250514 +definition_of_done: > + A scraper.py fetches and parses Hacker News front page stories. + A Story dataclass has title, url, points, and comments fields. + Results are output as JSON. A requirements.txt lists dependencies. diff --git a/actions/sim5-flask-auth.yaml b/actions/sim5-flask-auth.yaml new file mode 100644 index 00000000..7790a968 --- /dev/null +++ b/actions/sim5-flask-auth.yaml @@ -0,0 +1,12 @@ +name: local/flask-auth +description: > + Build a Flask web application with user authentication. Include register + and login endpoints, password hashing with bcrypt, JWT token generation, + and a protected endpoint that requires authentication. Use SQLite for + user storage. Include requirements.txt. +strategy_actor: anthropic/claude-sonnet-4-20250514 +execution_actor: anthropic/claude-sonnet-4-20250514 +definition_of_done: > + An app.py has Flask routes for register, login, and a protected endpoint. + Passwords are hashed with bcrypt. JWT tokens are used for auth. + SQLite stores users. A requirements.txt lists dependencies. diff --git a/src/cleveragents/agents/graphs/plan_generation.py b/src/cleveragents/agents/graphs/plan_generation.py index aa68b3cb..ad710dcc 100644 --- a/src/cleveragents/agents/graphs/plan_generation.py +++ b/src/cleveragents/agents/graphs/plan_generation.py @@ -63,14 +63,12 @@ PATH_HINT_RE = re.compile(r"@(?P[\w./-]+)") # Regex for extracting files from markdown-formatted LLM output. # Supports many common header patterns: -# ## filename.py -# ## `filename.py` -# ## 1. `filename.py` -# ### path/to/file.py -# ## **filename.py** -# # filename.py +# ## filename.py ## `filename.py` +# ## 1. `filename.py` ### path/to/file.py +# ## **filename.py** # filename.py +# **filename.py** **`filename.py`** _FILE_HEADER_RE = re.compile( - r"^#{1,3}\s+(?:\d+\.\s+)?[`*]*(?P[^\s`*]+\.[a-zA-Z0-9]+)[`*]*\s*$", + r"^(?:#{1,3}\s+(?:\d+\.\s+)?)?[`*]*(?P[^\s`*]+\.[a-zA-Z0-9]+)[`*]*\s*$", re.MULTILINE, ) _FENCED_BLOCK_RE = re.compile(