This document defines a lightweight agent-level evaluation protocol for CodeWell.
The goal is not to benchmark the raw model alone. The goal is to measure whether CodeWell improves an agent's task execution by providing better local retrieval and context assembly.
Measure the delta between:
baseline: an agent working without CodeWell retrievalcodewell: the same agent working with CodeWell search, trace, and context tools
The key question is:
Does CodeWell help a coding agent finish repository tasks with fewer search steps, less wasted context, and higher task success?
This protocol is intentionally lightweight.
It does not require:
- full SWE-bench scale
- remote infrastructure
- required LLM APIs inside CodeWell
- a new heavyweight benchmark runner before the task design is stable
It is designed for:
- Codex
- Claude Code
- similar local or semi-local coding agents
For each task, run two conditions:
baselinecodewell
Keep these factors fixed between the two runs:
- same repository snapshot
- same task statement
- same model or agent configuration
- same time budget or step budget
The main difference should be whether the agent is allowed to use CodeWell retrieval.
Start with 10-20 tasks before expanding further.
Recommended TS/JS-heavy categories:
- route or controller to service flow
- service to repository or data layer flow
- auth, guard, or middleware flow
- test to implementation discovery
- bootstrap, config, or wiring discovery
- frontend route to feature to API flow
- form submission to mutation to client call flow
- protected route or redirect logic
Store tasks as JSON using evaluations/agent_eval_task_template.json.
Each task should define:
- task id and name
- repository label and optional subpath
- task prompt
- language and framework tags
- expected files
- expected symbols
- optional expected trace relationships
- success criteria
Ground truth should be established before running the agent.
Store results using evaluations/agent_eval_result_template.json.
Each run should capture:
- condition:
baselineorcodewell - agent name and model
- task success
- final patch status
- files touched
- first relevant file hit
- tool call counts
- manual search steps
- approximate token usage if available
- token usage details when the local Claude session log exposes them
- elapsed time
- Claude session id and local log path for auditability when available
- notes about failure or confusion
Track both outcome and effort.
Outcome metrics:
task_success_ratecorrect_file_hit_ratecorrect_symbol_hit_ratefinal_patch_in_expected_area
Effort metrics:
time_to_first_relevant_file_secondstool_call_countmanual_search_stepselapsed_secondstoken_usagewhen available
Quality and failure metrics:
wrong_context_eventsirrelevant_file_open_countabandoned_runs
Aggregate results by:
- repository
- task category
- framework
- condition
- task bucket
Recommended summary fields:
- tasks total
- tasks succeeded
- success rate
- median elapsed seconds
- median time to first relevant file
- median tool call count
- median manual search steps
- median token usage
- wrong context event rate
The repo now includes a lightweight bucket-summary helper:
scripts/agent_eval_bucket_summary.pyevaluations/agent_eval_task_buckets.jsonscripts/agent_eval_repeated_run_summary.pyevaluations/agent_eval_prompt_goal_labels.jsonscripts/agent_eval_repeat_plan.pyevaluations/agent_eval_repeat_protocol_strong_multi_goal.json
Use it after one or more A/B result files have been produced:
python scripts/agent_eval_bucket_summary.py `
.agent-eval-wiring-temp\results\agent_eval_results.json `
.agent-eval-wiring-temp\results\agent_eval_results_phase2.json `
--bucket-file evaluations\agent_eval_task_buckets.jsonThis reports:
- complete A/B pair count
- incomplete task ids
- per-bucket success / elapsed / tool / token deltas
- overall summary across all completed pairs
Current buckets:
navigation-heavyobvious-near-obviousmiddle-bucket
The current internal wiring batch shows a clear pattern:
navigation-heavy: stable positive delta for CodeWellobvious-near-obvious: weak or negative delta, useful as a boundary bucket
Treat this bucketed view as the default lens for deciding whether a retrieval policy change is actually helping the right task type.
For prompts with high run-to-run variance, especially multi-goal prompts, use the repeated-run summary helper:
python scripts/agent_eval_repeated_run_summary.py `
.agent-eval-wiring-temp\results\agent_eval_results.json `
.agent-eval-wiring-temp\results\agent_eval_results_phase2.json `
.agent-eval-wiring-temp\results\agent_eval_results_post_nav_support_pass1.json `
--goal-label-file evaluations\agent_eval_prompt_goal_labels.jsonThis reports:
- sample count per task and condition
- median / mean / range for elapsed time, tool calls, and token usage
- first relevant file stability
- goal-shape labels such as
weak_multi_goalandstrong_multi_goal
Recommended interpretation rule:
- single-run results are acceptable for clearly stable tasks
- repeated-run median should be preferred for
strong_multi_goaltasks - high variance should be treated as a prompt-goal signal, not automatically as a retrieval failure
The repeated-run summary now also supports:
--goal-shape strong_multi_goalto filter by prompt goal shape--min-samples 3to focus on tasks with enough repeated evidence
Example:
python scripts/agent_eval_repeated_run_summary.py `
.agent-eval-wiring-temp\results\agent_eval_results.json `
.agent-eval-wiring-temp\results\agent_eval_results_phase2.json `
.agent-eval-wiring-temp\results\agent_eval_results_post_nav_support_pass1.json `
.agent-eval-wiring-temp\results\agent_eval_results_post_classifier_fix.json `
.agent-eval-wiring-temp\results\agent_eval_results_post_kernel_companion_fix.json `
--goal-label-file evaluations\agent_eval_prompt_goal_labels.json `
--goal-shape strong_multi_goal `
--min-samples 2strong_multi_goal tasks should now be treated as a separate protocol class rather than as normal
single-run A/B tasks.
Default rule:
- run
3A/B pairs per task - keep task text fixed across all repeats
- report median by condition
- inspect range and first-relevant-file stability before declaring a win or loss
Generate a repeat plan from the current goal labels:
python scripts/agent_eval_repeat_plan.py `
--goal-label-file evaluations\agent_eval_prompt_goal_labels.json `
--output evaluations\agent_eval_repeat_protocol_strong_multi_goal.generated.jsonThe repository also includes a checked-in current manifest for the present strong-multi-goal batch:
evaluations/agent_eval_repeat_protocol_strong_multi_goal.json.agent-eval-wiring-temp/results/agent_eval_repeats_strong_multi_goal.json
This makes the repeated-run protocol operational instead of ad hoc:
- selected task ids are explicit
- repeat count is explicit
- result-file naming is explicit
- per-run session labels are explicit
Current completed read for the checked-in strong-multi-goal batch:
- all
3tasks have now reached3samples per condition adonis_kernel_auth_middleware_wiringis the clearest stable-first-file casenestjs_users_admin_guard_service_wiringis the clearest unstable-first-file caseadonis_profile_route_auth_middleware_wiringdemonstrates why a partial repeated-run read can still flip after the third sample lands
Current interpretation rule should therefore be:
- treat
strong_multi_goalas a different evaluation slice, not a noisy version of normal tasks - require the full repeated-run protocol before using such tasks in a product-facing win/loss claim
Use the current maintained TS/JS real-project set first.
Suggested first batch:
- Express + Prisma
- Bulletproof React
- NestJS clean architecture
- NestJS boilerplate
- AdonisJS backend
Start with 2 tasks per project.
That gives a small but useful 10-task baseline for agent A/B comparison.
The repository includes a ready-to-run first batch at:
evaluations/agent_eval_tsjs_first_batch.jsonevaluations/agent_eval_tsjs_first_batch_results.empty.json
Keep evaluation source repositories separate from writable run workspaces.
Recommended split:
eval-repos/source-readonly/contains clean baseline source treesCodeWell_test/runs/contains per-run writable copies
Do not start Claude Code inside eval-repos/source-readonly/.
Only let scripts/agent_eval_session.py copy from that source root into a fresh run workspace.
The current automation defaults to eval-repos/source-readonly/ as --source-root.
Do not use eval-repos/github/ as a formal A/B source root. That older tree has already produced
polluted copies for at least one task and should be treated as a staging/import area, not as a
clean baseline.
Use the session helper to reduce the manual setup work around each run.
Fastest path for repeatable experiments:
python scripts/agent_eval_session.py run-once `
--task-id express_login_flow_patch_area `
--condition codewell `
--claude-model deepseek-v4-pro[1m]This fully automates one run:
- creates a fresh copied workspace
- configures MCP automatically for
codewell - runs
claude -pnon-interactively - saves the raw Claude output to
claude_output.txt - extracts the final JSON result
- writes the run into the aggregate results file
To run both baseline and codewell back-to-back for one task:
python scripts/agent_eval_session.py run-pair `
--task-id express_login_flow_patch_area `
--claude-model deepseek-v4-pro[1m]To run a whole task file in pair mode:
python scripts/agent_eval_session.py run-batch `
--claude-model deepseek-v4-pro[1m]Optional batch controls:
--task-ids task_a task_bruns only a subset--mode baselineor--mode codewellruns only one condition per task--continue-on-errorkeeps going after one failed task--first-condition codewellonrun-pairflips the order for that task
For a manual step-by-step run, use prepare-run plus record-run as described below.
Prepare a run:
python scripts/agent_eval_session.py prepare-run `
--task-id express_login_flow_patch_area `
--condition codewell `
--configure-mcpThis does four things:
- creates a fresh copied workspace under
CodeWell_test/runs/ - initializes the aggregate result file if it does not exist yet
- writes the exact Claude prompt into
prompt.txt - optionally toggles Claude Code MCP for the prepared workspace
The script prints a JSON payload with:
working_directoryprompt_fileresults_filenext_steps
After that, the human loop is short:
cdinto the printedworking_directory- start
claude - paste the prompt from
prompt_file - copy Claude's final output
Then record the result:
python scripts/agent_eval_session.py record-run `
--task-id express_login_flow_patch_area `
--condition codewell `
--results-file <agent-eval-root>\results\agent_eval_results.json `
--agent-name claude-code `
--model deepseek-v4-pro `
--result-json "<paste Claude final output here>"record-run extracts the JSON object from Claude's final answer and merges it into the aggregate
results file automatically.
For formal A/B runs:
- use a fresh copied workspace for every condition
- keep the same model, skills, and time budget across both runs
- use the same prompt text for
baselineandcodewell - prefer narrow prompts that name one concrete bug or behavior, not a broad "patch a bug in this area"
- only change whether CodeWell MCP is available
- if the agent drifts to a different bug, mark that run as failed or note prompt drift explicitly
This protocol comes before SWE-bench-style evaluation.
Use it first because it is:
- cheaper
- easier to reproduce locally
- easier to attribute to CodeWell itself
- more sensitive to retrieval and context quality
After this protocol is stable, a smaller SWE-bench-Lite-style comparison can be added as an external validation layer.