Repository navigation
fix(tier3): count edits, searches and MCP calls as productive and leave planning calls out of tool efficiency - #428
Conversation
… efficiency check_tool_efficiency counted a call as productive only when its name contained "read", "skill" or an execution hint, so Write, Edit, MultiEdit, apply_patch, scoped Grep/Glob/LS, Codex list_dir and grep_files, and MCP tools were all waste. A with-skill trial that read the skill, edited four files and ran the tests scored 0.33. Planning calls counted as waste and background-shell polling (BashOutput, KillShell) as command runs. Classify each call as productive, wasted or neutral. Neutral calls (TodoWrite, update_plan, background-shell control, ToolSearch, sub-agent calls) are left out of the score and counted in the reason and details. A list of only neutral calls scores like a list with no tool calls. Join argv-list commands with shlex.join before the root-search, expected-script and help/install checks, so ["bash", "-lc", "find / ..."] and ["find", "/", ...] are waste like the same command written as text. Root searches keep using _tool_searches_root. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
List the productive, wasted and neutral tool classes in reports.mdx, describe skill_efficiency under standard grading in tier3-live-evaluation.mdx, and add the Unreleased > Changed entry. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: CHANGELOG.md. Unreleased > Changed keeps main's three report entries, then this branch's tool efficiency entry. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iency A trial whose only calls were neutral (TodoWrite, update_plan, Task and the like) scored tool efficiency 1.0. Both skill_efficiency callers stop early for an empty trajectory and score it 0.0, so a planning-only trial got skill_efficiency 0.5 while a trial with no calls got 0.0. Return passed False and score 0.0 with the reason "No scored tool calls; N planning or bookkeeping call(s) not counted". A planning-only trial now scores skill_efficiency 0.0, like a trial with no tool calls. Neutral calls in a trial that also does work are still left out of the score. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fficiency The neutral set missed planning and sub-agent tools that Claude Code and Codex record: TaskCreate, TaskGet, TaskList, TaskUpdate, EnterPlanMode and Codex wait. A trial that read the skill, created three tasks, made two edits, updated three tasks and ran the tests scored 0.4 and failed, because all six task calls counted as waste. They are now neutral. Codex can also record its built-in tools under a namespace, such as functions.apply_patch or functions.update_plan. Classify a call by the name after the last dot, as trajectory timing already does, so those calls get the same class as the bare names. MCP tool names keep every part, so mcp__tasks__task stays an MCP call. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex write_stdin was always neutral, so a command typed into an interactive shell escaped the root-search rule: exec_command bash with tty, then write_stdin "find / -name review.py", scored 1.0. Claude Code Monitor, which runs its command as a background watch, counted as waste. write_stdin with no input, or only Enter or Ctrl-C, is polling and stays neutral, as is a Monitor watch with no command. Otherwise the text they send is classified like any other command: a root search or a help/version/install command is waste, other commands are productive. Wasted calls are labelled with that text. Every mcp__ call was productive, so an MCP filesystem search or listing from "/" got full credit while the same scan through Grep, Glob or find was waste. An MCP call whose path or dir_path is the root is now waste. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
shlex.join quotes an argv word that holds "$", a backtick or "#", and the root-search check then gave up on the whole command, as it does for shell text with expansions or comments. An argv list runs without a shell, so those characters are literal: ["grep", "-r", "#TODO", "/"] and ["find", "/", "-name", "$HOME"] scored 1.0 while ["grep", "-r", "TODO", "/"] scored 0.0. _tool_searches_root takes argv=True for text joined from an argument list and skips that bail-out for the list's own words. A "sh -c" payload inside the list is still shell text, so it scores like the same command written as text. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
- MCP credit applies to Claude Code mcp__server__tool names. Codex records MCP calls under the bare tool name, and those are classified by that name; the CHANGELOG says they are not recognized yet. - List the new neutral names (task lists, plan mode, Codex wait), the write_stdin and Monitor rule, namespaced Codex names, MCP calls on "/" and literal argv words. - A trial with only neutral calls scores tool efficiency 0.0, so its skill_efficiency matches a trial with no tool calls. - The CHANGELOG says help, version and install commands recorded as an argument list now count as waste, and a test pins those argv forms. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…em tools Other MCP servers use path for something other than the local disk. The GitHub server's get_file_contents with path "/" lists a repository root, and it was counted as a wasted root search. Only a tool whose name says it searches or lists (search, list, tree, find, glob, grep, directory), or a tool of a server whose name contains "filesystem", is now a root search when its path or dir_path is "/". Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The converter records a tool input that is not an object under "raw". For apply_patch that is the whole patch text, which was matched against the help, version and install words. A README patch that mentions pip install, or "which " in a sentence, made the patch a wasted call, while the same patch under "input" was productive. File paths of Read, Write and Edit were matched the same way. The words are now matched only in the command of a command run or session input, as before for those calls. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
OpenCode lists a directory with its "list" tool, where Claude Code uses LS. It counted as wasted, so an OpenCode trial that read the skill, listed /workspace, edited a file and ran the tests scored tool efficiency 0.75, while the same Claude Code trial scored 1.0. "list" is now a productive tool, and a "list" on / is a root search, like LS. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ncy rules Say which MCP calls on / are root searches, list OpenCode list with the productive listings, and note that OpenCode MCP calls, like Codex ones, are not recognized yet. The CHANGELOG now names dir_path with path, says that a trial of only background-shell polling drops from 1.0 to 0.0 instead of "still" scoring 0.0, and says that help, version and install words are matched in commands only. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
… 0.0 A TaskStop-only trial already scored 0.0, so say that trials of only BashOutput or KillShell calls drop from 1.0 to 0.0. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main gained a first line in check_tool_efficiency (#402) right under the docstring this branch rewrites. Both are kept: this branch's docstring, then main's expected_script normalization. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Reviewed the complete production diff and regression coverage; checked productive/neutral/wasted classes, namespaced and MCP calls, interactive shell input, literal argv handling and root-search precedence. No actionable findings.
Verification at unchanged head 53cae2ab829f064fe02223d1bb376cf9242f5098: 20 existing CI checks succeeded and 2 were intentionally skipped, including the supported Python tests, lint/package and security/platform gates where applicable. Fresh git merge-tree --write-tree is clean against the frozen main commit ce52a09. No new local test run is claimed for this unchanged code.
rng1995
left a comment
There was a problem hiding this comment.
Follow-up documentation navigation review found newly introduced links that fail in the pinned Fern preview:
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
There was a problem hiding this comment.
Final review at 5ff9f47e8ca5da98d34806089638931c836fb725: Reviewed the full tool-productivity implementation and regression coverage, including neutral calls, namespaces/MCP, argv handling and root-search precedence. Corrected the newly introduced Reports navigation link to its published route. The production logic retains its prior exact-head green CI evidence; the only additional edit is the documentation URL plus a clean frozen-main merge. No new unit tests were added for the URL correction.
Pinned Fern 5.121.0 check passes with 0 errors; its only warning skips the authenticated redirects check because FERN_TOKEN is unavailable. Independent preview evidence shows the published routes return HTTP 200 and the previous relative .mdx routes return HTTP 400. Every reported thread is replied to and resolved. Signed-off commits were pushed normally after live-head checks. Fresh CI for this final SHA is pending; root is watching it to completion. No merge performed.
Brings in main through b38b71b (#416, #417, #420, #422, #423, #428, #429, #467). Merged without conflicts; CHANGELOG, docs, decoys.py and eval_core/checks.py auto-merged with both sides' edits in separate hunks. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Tier 3 tool efficiency, half of
skill_efficiency, now classifies each tool call as productive, wasted or neutral. All code changes are insrc/skillevaluator/tier3/eval_core/checks.py:check_tool_efficiency, the new helpers above it, and anargvflag and OpenCode'sliston_tool_searches_root. The bundled verifier already delegates tocheck_tool_efficiency.Write,Edit,MultiEdit,NotebookEdit,write_file,edit_file,apply_patch, scopedGrep,Glob,LS, OpenCodelist, Codexlist_dirandgrep_files,Skill, command runs, and MCP tools namedmcp__server__tool(Claude Code).TodoWrite,TodoRead,update_plan, task lists (TaskCreate,TaskGet,TaskList,TaskUpdate),EnterPlanMode,ExitPlanMode, background-shell polling (BashOutput,KillShell,KillBash,kill_shell,TaskStop,TaskOutput),ToolSearch, and sub-agent calls (Task,Agent, Codexspawn_agent,wait,wait_agent,close_agent,send_input,resume_agent). The reason ends with; N planning or bookkeeping call(s) not counted, anddetailsgains aneutralcount.BashOutputandKillShellno longer get execution credit from thebash/shellsubstring.write_stdinwith no input, or only Enter or Ctrl-C, is polling and neutral, as is aMonitorwatch with no command. Text typed withwrite_stdin, or the commandMonitorruns, is classified like any other command, so a root search typed into an interactive shell is waste. A wasted call of this kind is labelled with that text.No scored tool calls; N planning or bookkeeping call(s) not counted, so itsskill_efficiencyis 0.0, the same as a trial with no tool calls. Onmain, a trial of only planning or sub-agent calls also scored 0.0, but a trial of onlyTodoRead(OpenCodetodoread),BashOutput,KillShell,KillBashorkill_shellcalls scored 1.0, from theread,bashorshellin the name. That trial now drops to 0.0.functions.apply_patchorfunctions.update_plan, are classified by the part after the last dot. MCP names keep every part, somcp__tasks__taskstays an MCP call.pathordir_pathis/is a root search and counts as waste, like the same scan throughGrep,Globorfind. A call is one when its tool name containssearch,list,tree,find,glob,grepordirectory, or its server name containsfilesystem. Other servers usepathfor other things:mcp__github__get_file_contentswithpath/lists a repository root and is productive.write_stdin/Monitorinput. A patch given to a patch tool, a file path or file text that mentionspip install,--helporwhichis not waste, soapply_patchscores the same whether the patch is recorded underinput,patchTextor the converter'srawfallback for a non-object input.commandorcmd) is joined withshlex.joinbefore the root-search, expected-script and help/version/install checks.["bash", "-lc", "find / -name x"]and["find", "/", "-name", "x"]are now waste, and so are["pip", "install", "-e", "."],["npm", "install"]and["which", "jq"], like the same command written as text. The list's own words are literal (no shell runs them), so$, backticks and#in them do not stop the root-search check:["grep", "-r", "#TODO", "/"]is waste. Ash -cpayload inside the list is still shell text and scores like the same command written as text. The wasted-call label indetailsstill shows the recorded list.server_tool, so they are classified by that name like any other tool, and most count as wasted. Recognizing them needs each agent's MCP server map and is left for a follow-up. The CHANGELOG and both docs pages say so.docs/reports.mdx(the tool-efficiency paragraphs under the five dimensions) lists the classes;docs/tier3-live-evaluation.mdxdescribesskill_efficiencyunder standard grading. CHANGELOG entry under Unreleased > Changed.Why
On current
main,check_tool_efficiencycounted a call as productive only when its name containedread, was exactlySkill, or contained an execution hint (bash,run,shell, ...). Everything else was waste. Onmain:Editfour files, runpytest -q: 0.33 (2 of 6).exec_command+ 2apply_patch+update_plan: 0.25, with or without thefunctions.prefix.readthe skill,list/workspace,edita file,bashpytest -q: 0.5.Grep,Write, anapply_patchor an MCP call alone: 0.0.TodoWritealone: 0.0.BashOutput+KillShell: 1.0.TaskCreate, 2Edit, 3TaskUpdate,pytest: 0.2 (2 of 10), which fails the 0.5 threshold.shellwith["bash", "-lc", "find / -name review.py"]or["find", "/", "-name", "review.py"]: 1.0, because the list was turned into its Python repr before the root-search check.So a with-skill trial that edits files, patches them or uses search and MCP tools lost up to about half of its
skill_efficiency, a third in the first example above.skill_efficiencyfeeds the Efficiency dimension, the overall score and the verdict. Planning calls other thanTodoReadcounted as waste, and background-shell polling as work. Lift is unaffected because the baseline arm'sskill_efficiencyis N/A.Kept from public
_tool_searches_root, which tokenizes the command, unwrapssh -c, skips redirection targets and leaves expansions, comments and here-documents in shell text alone. No regex scan replaces it. The only changes to it are theargvflag, which skips the expansion and comment bail-out for the words of an argv list, not for ash -cpayload inside it, and OpenCode'slistamong the native search names.skill_efficiencystays the mean of routing and tool efficiency in the verifier. The verifier template is unchanged.No tool callsand score 1.0; bothskill_efficiencycallers stop before it and score an empty trajectory 0.0. An only-neutral list scores 0.0, so no N/A handling is needed. Onmainthat was already the score of a trial with only planning or sub-agent calls other thanTodoRead; a trial with onlyTodoRead(OpenCodetodoread),BashOutput,KillShell,KillBashorkill_shellcalls scored 1.0 and now scores 0.0.detailskeepsproductive,wasted,totaland up to fivewasted_calls;neutralis added.checks.py: fix(tier3): report missing tools as environment problems, not skill defects #379 the error-recovery and workflow checks andscore_skill_execution, fix(tier3): decode inline and Promise.allSettled Codex wrappers (#235) #325 the Codex wrapper decoding, feat(tier3): add selectable NeMo Gym execution backend #225 the skill-read helpers for the NeMo Gym backend. This PR changes only_tool_searches_root's signature, its native search names and its bail-out line, the block abovecheck_tool_efficiencyand that function. fix(tier3): treat placeholder expected_script and behavior values as no expectation #402, now merged, added a first line tocheck_tool_efficiencyright under the docstring this PR rewrites; the merge withmainkeeps both. Several open PRs also edit other paragraphs ofdocs/tier3-live-evaluation.mdxanddocs/reports.mdx.Tests
tests/tier3/test_tool_productivity.py(292 tests). All but eight are parametrized over the host checks module and the bundled verifier template; host cases also check_tool_call_productivitydirectly.apply_patch, OpenCodelist,list_dir,grep_files, an argvshellcall and anmcp__tool)BashOutputandKillShellget no execution credit; a run with 3TaskCreateand 3TaskUpdatescores 4/4 with 6 not counted;spawn_agent+waitscores likespawn_agent+wait_agentwrite_stdinandMonitor(11 cases): no input, Enter or Ctrl-C and a WebSocket watch are neutral; typed or watched commands are productive; root searches andpip installare wasted;bashwith a tty plus a typedfind /scores 0.5/throughpathordir_path, by tool name or by afilesystemserver, are wasted (5); scoped ones and a/inside a query are productive (3); MCP tools named like bookkeeping tools stay MCP calls (3)pathordir_path/are productive (4), includingmcp__github__get_file_contentswithpath/andsrc/pip install,--help,which,apt-getandbrewis productive forapply_patch,functions.apply_patchandapplypatchunderinput,raw,patchandpatchText(3 tests);Editwith that patch underraw, aWriteorReadwhose path holds an install word and an MCP search query are productive (4);exec_commandwithrawpip install requestsis still wastedreadthe skill,list/workspace,edit,bashpytest -q) gives the same result as the Claude Code trial withRead,LS,EditandBash: 4/4functions.*patch run scoring 3/3 with 1 not counted/are wasted (9, including OpenCodelist), scoped ones productive (7); native and shell root scans score the samedetailscounts neutral calls and labels a wasted argv call with its recorded list and a wastedwrite_stdincall with its text; only bookkeeping records zero scored callsmain()(5): Read the skill,TodoWrite, 4Edit,pytest -qgives tool efficiency 6/6 with 1 call not counted, andskill_efficiencyis the mean of routing and 1.0; a trial with no calls, onlyTodoWrite, onlyupdate_planor onlyTaskgetsskill_efficiency0.0, and the hostscore_skill_efficiencyagreestests/tier3/test_root_search_efficiency.py: scopedGrep/Globcalls now expect 1.0 instead of 0.0, and 36 new argv tests: root searches undercommandandcmdare waste; argv words with#,$or a backtick are literal, so a root operand is still found (4), while scoped ones stay productive (2); abash -lcpayload with a comment or$(...)scores like the same text (2);["python", "task.py"],["bash", "-lc", "python task.py"]and scoped argv commands stay productive; argv root search plus script run scores 0.5. 184 passed.main(d136a597src/, this PR's tests): 258 failed, 218 passed. That is 236 of 292 intest_tool_productivity.pyand 22 of 184 intest_root_search_efficiency.py. The host cases also fail because_tool_call_productivitydoes not exist onmain. The tests that pass onmainpin behavior that does not change, such as scoped shell searches staying productive and a trial of onlyTodoWrite,update_planorTaskgettingskill_efficiency0.0.pytest -n 4 tests/tier3: 10027 passed, 3 skipped. The run includestest_checks_path_extraction.py,test_codex_tool_call_normalization.py,test_shared_check_adapters.py,test_harbor_template_secret_patterns.pyandtest_apply_patch_security.py.tests/test_ci_workflows.py,tests/test_oss_packaging.py,tests/test_benchmark_rollout_docs.py,tests/test_ci_change_classifier.py,tests/test_harbor_claude_refusal_fallback.py,tests/test_accuracy_arithmetic.py,tests/test_tier3_public_runtime.pyandtests/ci/test_image_build.py(the CHANGELOG and docs readers): 545 passed.mainatd136a597. The CHANGELOG conflict with Keep report navigation persistent and evidence accessible #352's entries is resolved by keeping Keep report navigation persistent and evidence accessible #352's three Unreleased > Changed entries first and this entry after them.mainat86f1a1f0was then merged in to resolve aCHANGELOG.mdconflict with feat(ci): add three-tier onboarding and private report feedback #349's entries; both entries are kept.mainatfff533288was merged in last:check_tool_efficiencykeeps this PR's docstring followed by fix(tier3): treat placeholder expected_script and behavior values as no expectation #402'sexpected_scriptnormalization, and this PR's tests (498) pass on the merged tree.ruff checkandruff format --checkare clean on the changed Python files, andscripts/check_oss_boundary.pypassed.🤖 Generated with Claude Code