Skip to content

Measure shipping helper effects in agent runs - #1664

Open
napetrov wants to merge 4 commits into
intel:mainfrom
napetrov:ai-ready/wp3-helper-effect
Open

napetrov wants to merge 4 commits into
intel:mainfrom
napetrov:ai-ready/wp3-helper-effect

Conversation

@napetrov

@napetrov napetrov commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Summary

AI-Ready checklist v1.5 action 7.

one task × agent × model × repeat
├── base → fresh host workspace
└── each shipping helper → fresh host workspace + helper
    same checker → paired Usage difference

dokimi agent run --arms base,assets --helper NAME=DIR measures a skill, AGENTS.md, docs index or agent-native MCP configuration. It uses matched, scorable sessions on both sides. A negative effect or no shipping helper fails the gate. Missing matched evidence is inconclusive. The slice in docs/coding-harnesses.md describes the paired rubric, helper files and host-mode scope.

A Codex Linux sandbox failure is inconclusive when a failed tool event and a failing independent native sandbox probe both support it. The probe gets no model route credentials. A passing product checker retains its verdict.

Evidence

  • Before, every task had one context condition. A missing Codex Linux namespace could lower Usage even though the host prevented the edit.

  • Live Linux smoke with Claude Code Haiku on Bedrock, one synthetic task and a single pair. The controls returned PASS and FAIL. The checker returned FAIL at 65 points without the docs index and PASS at 100 with it. Paired Usage was 6.5 → 10.0. The command exited 1 for the baseline checker failure and the helper gate reported PASS.

  • pytest tests/test_helper_effects.py tests/test_agent_environment.py tests/test_agent_run.py tests/test_run_envelope.py covers pair isolation, good and wrong evidence, scoring, native launcher argument placement and independent sandbox confirmation.

  • The Linux namespace regression was also checked against a prior captured Codex session on this host. Helper treatments run in host mode. A native Windows MCP run is pending.

  • make ci-local reported 0 failed, 38 passed and 16 skipped. The suite passed 36,273 tests, all 20 changed-test repeats passed, and changed-line coverage was 88%. The advisory mutation check reported 13 surviving and 26 unrun mutations.

Merge Danger

Door Two-way.

Blast radius Opt-in host helper runs and the Codex Linux infrastructure verdict.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
(cherry picked from commit b800225aac0735b827d74f68476636337234ad0d)
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
(cherry picked from commit ab89a736222856242d3766b01f750387c3f3400f)
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov
napetrov requested a review from a team as a code owner December 6, 2026 06:56
Copilot AI balanced review requested due to automatic review settings December 6, 2026 06:56
@github-actions github-actions Bot added the cli-interface-change Changes dokimi's user-facing CLI surface label Dec 6, 2026
@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown

CLI interface change detected

This PR changes dokimi's user-facing CLI surface (commands and/or options):

~ `dokimi agent run` parameters changed:
    + added option `--arms`
    + added option `--helper`

Updated on every push; the cli-interface-change label is on while the diff is non-empty.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical issues remain: valid helper TOML can be nested under the model-provider table instead of installing MCP servers, and referenced authentication variables are filtered out, preventing authenticated helpers from connecting.

2 open issues
What changed in this PR

2 new findings.

This PR extends coding-agent evaluations to measure shipping helpers against matched baseline sessions.

Changes:

  • Adds host-mode helper installation, paired scoring, and gate results.
  • Classifies independently confirmed Codex Linux sandbox failures as inconclusive.
  • Updates tests, artifact schema, CLI references, and documentation.
File Description
README.md Introduces helper measurement.
dokimi/​tests/​test_helper_effects.py Tests helper installation and paired scoring.
dokimi/​tests/​test_agent_run.py Updates runner mocks for keyword arguments.
dokimi/​tests/​test_agent_environment.py Tests sandbox failure classification.
dokimi/​tests/​data/​cli_flags_allowlist.txt Clarifies the --arms comment.
dokimi/​dokimi/​schemas/​agent_run.v1.json Adds helper comparison results.
dokimi/​dokimi/​commands/​agent_run.py Adds helper options and gate-aware exits.
dokimi/​dokimi/​cli_flags.py Registers --helper.
dokimi/​dokimi/​agent_run/​runner.py Runs helper treatments and sandbox probes.
dokimi/​dokimi/​agent_run/​helpers.py Installs helpers and computes paired effects.
dokimi/​docs/​reference/​cli-interface.json Records new CLI options.
dokimi/​docs/​coding-harnesses.md Documents helper measurement and sandbox handling.
dokimi/​changelog.d/​20261202_codex_sandbox_unavailable.md Records sandbox classification changes.
dokimi/​changelog.d/​20261124_030000_agent-helper-effect.md Records helper comparison support.
AGENTS.md Adds helper measurement guidance.

Review effort: Balanced

Comment on lines +55 to +56
with (config / "config.toml").open("a", encoding="utf-8") as file:
file.write("\n" + server.read_text(encoding="utf-8"))
Comment on lines +160 to +161
if helper is not None:
helper.install(workspace, config, agent.name, cmd)
@exai-bot

exai-bot commented Dec 6, 2026 •

Copy link
Copy Markdown

🔍 OpenCodeReview found 1 issue(s) in this PR.

CI at 43b1efd: 23 passing, 5 skipped.

By label: 1 nit

Label Location Finding
nit test_agent_environment.py:28 Impact: this new regression test fails on Windows rather than exercising the sandbox classification.
Review details
  • Commit reviewed: 43b1efd against merge base 19e5222
  • Coverage: 15 files in 2 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 789k tokens (539k from cache), 1m24s
  • Tool calls: 56 (32 file_read, 7 code_search, 6 file_read_diff, 4 ci_status, 3 pr_comments, 2 code_comment, 2 local_check_results)
  • Agent helper effects, execution, schema, and documentation: 9 files
  • Codex sandbox availability and CLI environment handling: 6 files

):
monkeypatch.setattr(adapters, "_WINDOWS", False)
monkeypatch.setattr(runner.sys, "platform", "linux")
monkeypatch.setattr(runner.shutil, "which", lambda _: "/usr/bin/codex")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test · nit
Impact: this new regression test fails on Windows rather than exercising the sandbox classification.

Trigger: run python -m pytest tests/test_agent_environment.py on Windows.

Evidence: _host passes os.path.abspath(sandbox) to the probe; on Windows the mocked /usr/bin/codex becomes a drive-qualified Windows path, so it never matches the mock's argv[0] == "/usr/bin/codex" branch. The fallback returns a successful checker response and leaves probes empty, breaking the cases that expect a probe.

Fix: Use an absolute path derived from tmp_path for both which and the probe comparison.

Workaround: run this test on Linux.

Nit: Checked by reading the code; nothing was run.

Read, not run: a second, independent read agrees and cites dokimi/tests/test_agent_environment.py:28, dokimi/dokimi/agent_run/runner.py:184, dokimi/dokimi/agent_run/runner.py:194, dokimi/tests/test_agent_environment.py:49, dokimi/tests/test_agent_environment.py:62.

@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Tests miss 10 of 47 small breaks of the lines this PR changes, and the check was not complete

At 43b1efd: 37 caught · 10 missed · 33 not tried in time

Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put # mutation-ok[<operator>]: <reason> at the end of the line or alone on the line above.

Where Operator Change no test notices Tests reaching the line
dokimi/dokimi/agent_run/helpers.py:20 flip-bool True → False 4
dokimi/dokimi/agent_run/helpers.py:49 drop-clause agent == "claude-code" and (server := self.root / "claude-mcp.json").is_file() → ((server := self.root / "claude-mcp.json").is_file()) 4
dokimi/dokimi/agent_run/helpers.py:54 drop-clause agent == "codex" and (server := self.root / "codex-mcp.toml").is_file() → ((server := self.root / "codex-mcp.toml").is_file()) 4
dokimi/dokimi/agent_run/helpers.py:60 drop-clause isinstance(config, dict) and set(config) == {key} and isinstance(config[key], di → (isinstance(config, dict) and isinstance(config[key], dict) and bool(config[key] 5
dokimi/dokimi/agent_run/helpers.py:68 drop-clause results and all(row["effect"] is not None and row["effect"] >= 0 for row in resu → (all(row["effect"] is not None and row["effect"] >= 0 for row in results)) 2
dokimi/dokimi/agent_run/helpers.py:83 drop-clause not _scored(row) or not _scored(with_helper) → (not _scored(row)) 2
dokimi/dokimi/agent_run/helpers.py:94 drop-clause row["verdict"] in ("PASS", "FAIL") and row["points"] is not None → (row["points"] is not None) 2
dokimi/dokimi/agent_run/runner.py:92 drop-clause "base" in names or len(names) != len(self.helpers or ()) → ("base" in names) 45
dokimi/dokimi/agent_run/runner.py:94 drop-clause self.helpers or () → (()) 45
dokimi/dokimi/agent_run/runner.py:95 delete-statement helper.validate() → pass 1

Not the whole picture:

  • 33 breaks were not tried before the time budget ran out
  • 145 more breaks of covered changed lines were over the limit and not tried
  • 19 changed lines were not mutated

Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 82.67717% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.40%. Comparing base (19e5222) to head (43b1efd).

Files with missing lines Patch % Lines
dokimi/dokimi/agent_run/runner.py 76.47% 5 Missing and 3 partials ⚠️
dokimi/dokimi/commands/agent_run.py 52.94% 6 Missing and 2 partials ⚠️
dokimi/dokimi/agent_run/helpers.py 92.10% 3 Missing and 3 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1664      +/-   ##
==========================================
- Coverage   96.44%   96.40%   -0.04%     
==========================================
  Files         585      586       +1     
  Lines       76600    76719     +119     
  Branches    13175    13197      +22     
==========================================
+ Hits        73876    73964      +88     
- Misses       1671     1689      +18     
- Partials     1053     1066      +13     
Files with missing lines Coverage Δ
dokimi/dokimi/cli_flags.py 100.00% <ø> (ø)
dokimi/dokimi/agent_run/helpers.py 92.10% <92.10%> (ø)
dokimi/dokimi/agent_run/runner.py 86.79% <76.47%> (-2.28%) ⬇️
dokimi/dokimi/commands/agent_run.py 87.61% <52.94%> (-6.33%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli-interface-change Changes dokimi's user-facing CLI surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants