Repository navigation
feat(tier3): let installed packages add custom execution backends - #215
Conversation
Add a `skillevaluator.env_modes` entry-point group. Each entry names an EnvModePlugin that points at a Harbor BaseEnvironment class and declares the --ek kwargs, required kwargs, reserved kwargs, host variables, prerequisite hook, agent wrappers, and Compose support for that mode. Plugin modes reuse the existing Harbor-native policy: runtime-policy and secret-bearing kwargs are rejected, only declared host variables reach the Harbor process, skill runtime_env cannot set them, and a plugin may not forward agent credentials, judge settings, or process-control variables. Plugins cannot shadow built-in modes, are imported only when selected, and can be disabled with SKILLEVALUATOR_DISABLE_ENV_MODE_PLUGINS=1. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Roshni Malani <[email protected]>
1d09960 to
31c258e
Compare
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 6 findings (0 P1, 3 P2, 3 P3); 6 posted inline.
…ries Address review findings on the plugin hook: - Refuse plugin host variables that Harbor's stock agents or other backends read as credentials: agent CLI prefixes (ANTHROPIC_, CLAUDE_, CODEX_, OPENAI_, OPENCODE_, GEMINI_), git and model hub tokens (GH_, GITHUB_, GITLAB_, HF_, HUGGING_FACE_), provider and operator secrets, and other built-in backends' secret variables. KUBECONFIG stays allowed. - Require upper-case host variable names so skill runtime_env cannot bypass the protection with a different case. - Keep published benchmark cards keyed on built-in modes; plugin modes render as "Isolated sandbox" with no derived isolation note. - Import the plugin's environment module before preflight and unwrap Harbor's ValueError around import failures so install_hint is shown. - Refuse a mode name registered by more than one package and name the conflicting distributions. - Add host_path_env_vars and host_path_environment_kwargs so relative paths are anchored before Harbor changes directory. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Roshni Malani <[email protected]>
|
@rng1995 Thanks for the review. Comments addressed, PTAL ? |
|
@rmalani-nv : could we use “custom execution backends” instead of “plugin modes” consistently across the PR title, documentation, user-facing messages, and new public API? “Plugin” already refers to agent plugins being evaluated, so reusing it for execution infrastructure could be confusing. |
|
Could we add a small integration test that installs a separate backend package and exercises discovery, It would also help to document that backend packages must support the pinned Harbor version and preserve the evaluator’s staged image, workspace, and verifier requirements. A full baseline/treatment run—with correct outputs, artifacts, and cleanup—could then be the acceptance test for each backend integration. |
rng1995
left a comment
There was a problem hiding this comment.
Re-reviewed head 0377555, including the changes since the earlier review and existing discussions. Two additional reproducible findings are inline; I am also following up in the existing duplicate-registration thread for a remaining edge case. Validation with the repository lock: 385 focused tests passed, 1 deselected; all 17 current CI check runs succeeded. The failure reproductions use synthetic credentials and a backend test double, not a live external backend.
Address maintainer and review feedback on the env-mode extension point: - Rename "plugin modes" to custom execution backends across the public API, messages, and docs: EnvironmentBackendSpec, EnvironmentBackendError, custom_backend_names, load_custom_backend, and SKILLEVALUATOR_DISABLE_CUSTOM_BACKENDS. The --env-mode flag and the skillevaluator.env_modes entry-point group are unchanged. - Redact backend load and factory failures with the same secret handling as preflight before they reach doctor, kwarg validation, or run errors. - Resolve a backend's agent wrapper together with the provider's: keep a backend wrapper that subclasses the provider wrapper (for example SkillEvaluatorGatewayCodex for openai-compatible Codex), and stop with a configuration error instead of silently replacing it otherwise. - Count registrations per distribution, so two packages registering the same target are refused as ambiguous while one package seen twice on sys.path is one claim. - Drop allow_workload_identity from --ek only for gke, where it is a SkillEvaluator wrapper option, so a backend that accepts it receives it. - Add a fresh-process integration test that builds and installs a separate backend wheel and checks discovery, doctor, and Harbor import-path dispatch. - Document what a backend must provide (pinned Harbor, staged image, workspace, verifier artifacts, cleanup) and the baseline/with-skill acceptance run. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Roshni Malani <[email protected]>
|
@chrisknvidia thanks, both done in 07054da. Naming. Agreed that "plugin" collides with the agent plugins under evaluation. The PR now says "custom execution backends" in the title, description, docs, CHANGELOG, user-facing messages, and public API:
Integration test.
Docs. I added "What a backend must provide":
The acceptance test is a full baseline plus with-skill Tier 3 run on the backend, with expected scores, retained artifacts, no leftover resources, and results compared against I also fixed the inline findings from you and @rng1995 (workload-identity scoping, redaction of load failures, Codex wrapper resolution with gateway providers, duplicate claims with identical targets) and replied on each thread. Full suite: 13,752 passed. The only 2 failures are the Docker sidecar tests that fail the same way on |
…-214-env-mode-plugins Signed-off-by: Roshni Malani <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Re-reviewed at 8bd194d. All inline threads are addressed. I re-ran my original repros against a real dist-info backend package on sys.path (not monkeypatched entry points), and each case now behaves as intended:
- Credential forwarding: every name from the original finding is refused, and so are
AWS_*,GOOGLE_APPLICATION_CREDENTIALS,NVIDIA_API_KEYandGEMINI_API_KEY.KUBECONFIGand the backend's ownACME_SANDBOX_URLstill reach Harbor. - Host variable case: lower- and mixed-case names are rejected when the spec is built. A skill's
runtime_envcan't override a declared variable in any casing. - Benchmark cards:
benchmark.pyis no longer changed, and a custom backend renders asIsolated sandbox. install_hint: shown when the backend SDK is missing.- Duplicate claims: refused and named, including identical targets from two packages. One package seen twice on
sys.pathcounts once. - Relative paths: values in
host_path_env_varsandhost_path_environment_kwargsare made absolute. Undeclared values are left unchanged. allow_workload_identity(@chrisknvidia's thread): a backend that declares it now receives--ek allow_workload_identity=true, and the filter applies to GKE only. I've left that thread for Chris to resolve.- Redaction: a synthetic token in a load or factory failure is redacted in
doctor, the kwarg policy error,build_harbor_run_command, and the runtime wrapper path. - Codex wrappers: a
SkillEvaluatorGatewayCodexsubclass is kept for bothopenaiandopenai-compatible. A plainCodexsubclass is kept foropenaiand refused foropenai-compatible. With no backend entry, the provider's wrapper is used.
The rename to custom execution backends, the installed-wheel integration test, and the "What a backend must provide" docs cover Chris's general comments.
Locally, the new tests plus the related Tier 3 suites: 6,736 passed, 1 failed. The failure is test_harbor_local_mode.py::test_streamed_timeout_callback_matches_result_and_contains_descendants, a timing flake in code this PR doesn't touch; it passes on rerun.
Before merge: the merge with main after the 0.6.0 release put this PR's CHANGELOG entry under ## 0.6.0 - 2026-10-20 / ### Added. This change isn't in 0.6.0, so please move the entry under ## Unreleased in its own ### Added section.
Optional nit: for a duplicate claim, doctor prints "... Uninstall all but one. Reinstall the package that provides custom execution backend 'shared'." The generic reinstall hint contradicts the first sentence.
Merge main 3728e2f (#215 custom execution backends, #212 judge-aware lift, v0.6.0 release). Conflicts: - src/skillevaluator/tier3/harbor/runner.py: the unsupported env_mode failure keeps the PR's coded INVALID_CONFIGURATION result with main's _supported_env_modes() list (built-in plus installed custom backends). The runtime-plan failure keeps the PR's coded result, followed by main's new try/except around the agent_import_paths selection. - CHANGELOG.md (auto-merged): git placed the PR's error-code entry in the released 0.6.0 section; moved it to Unreleased under ### Added. Main's 0.6.0 section is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Main's #215 added a terminal failure to _run_harbor_eval_impl when an installed custom execution backend's agent wrapper cannot be selected (its wrapper does not subclass the provider's required wrapper, cannot be imported for that check, or the backend fails to load). It still returned the legacy {"error": [...]} shape, so it was the only terminal failure in the run entry point without execution_status or error_code. It now returns the PR's coded result with SKILLEVALUATOR-CONFIG-001, the same code as the runtime-plan rejection raised just before it in the credential-validation stage. The new test fails on the merge commit with the legacy shape. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Brings in main up to 3728e2f: #212 judge-aware lift, 15adf98 (schema "unavailable" rejection) and #215 custom execution backends. Conflicts: - docs/cli-reference.mdx: kept the branch's experimental hermes agent note and main's custom execution backends sentence on --env-mode. - src/skillevaluator/cli.py: import MAX_TRIAL_RETRIES and PLUGIN_LOAD_CHOICES with main's all_env_modes; --env-mode lists installed backends. - src/skillevaluator/tier3_environments.py: kept the branch's plugin-load and trial-retry constants and main's custom backend registry. - src/skillevaluator/tier3/harbor/collector.py: main's strategy-aware aggregate matcher keeps the branch's N/A-metric filter; main's constituent judge models merge runs before the branch's artifact-aware failure and N/A merges. - src/skillevaluator/tier3/harbor/runner.py: an explicit agent import path may be a native plugin wrapper or a custom backend's wrapper; agent import paths and the arm base paths are resolved inside main's backend error handling before native plugin wrappers are chosen. The arm base for a custom backend is the backend's own agent wrapper (else the stock agent), as build_harbor_run_command launches it, so a native wrapper over an unknown base falls back or refuses. - src/skillevaluator/evaluation/tier3_report.py: both helper sets kept. Lift data uses main's type check and the branch's activation-aware intervals; dimensions take main's judge_lift and the branch's baseline N/A flag; evaluators keep lift None without a comparison (main's judge exclusion included). When judge-mixed cases exist, the effectiveness headline (or the legacy members comparison) and its basis come from the matching-judge comparison (#212), the case-weighted interval that pairs those cases is dropped, partial and never-activated comparisons still get no lift, and the lift note says when no matching- judge comparison remains. Main's _dimension_score calls use the branch's weighted_dimension_score. - src/skillevaluator/reporting/cli.py: the branch's None-safe evaluator table renders a missing score, baseline or lift as main's "n/a". - tests/reporting/test_reporters.py: both test sets kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
* feat(tier3): let installed packages register --env-mode plugins * fix(tier3): tighten env-mode plugin credential and publication boundaries * feat(tier3): name them custom execution backends and close review gaps Signed-off-by: Roshni Malani <[email protected]>
Merge main 3728e2f (#215 custom execution backends, #212 judge-aware lift, v0.6.0 release). Conflicts: - src/skillevaluator/tier3/harbor/runner.py: the unsupported env_mode failure keeps the PR's coded INVALID_CONFIGURATION result with main's _supported_env_modes() list (built-in plus installed custom backends). The runtime-plan failure keeps the PR's coded result, followed by main's new try/except around the agent_import_paths selection. - CHANGELOG.md (auto-merged): git placed the PR's error-code entry in the released 0.6.0 section; moved it to Unreleased under ### Added. Main's 0.6.0 section is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Main's #215 added a terminal failure to _run_harbor_eval_impl when an installed custom execution backend's agent wrapper cannot be selected (its wrapper does not subclass the provider's required wrapper, cannot be imported for that check, or the backend fails to load). It still returned the legacy {"error": [...]} shape, so it was the only terminal failure in the run entry point without execution_status or error_code. It now returns the PR's coded result with SKILLEVALUATOR-CONFIG-001, the same code as the runtime-plan rejection raised just before it in the credential-validation stage. The new test fails on the merge commit with the legacy shape. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Brings in main up to 3728e2f: #212 judge-aware lift, 15adf98 (schema "unavailable" rejection) and #215 custom execution backends. Conflicts: - docs/cli-reference.mdx: kept the branch's experimental hermes agent note and main's custom execution backends sentence on --env-mode. - src/skillevaluator/cli.py: import MAX_TRIAL_RETRIES and PLUGIN_LOAD_CHOICES with main's all_env_modes; --env-mode lists installed backends. - src/skillevaluator/tier3_environments.py: kept the branch's plugin-load and trial-retry constants and main's custom backend registry. - src/skillevaluator/tier3/harbor/collector.py: main's strategy-aware aggregate matcher keeps the branch's N/A-metric filter; main's constituent judge models merge runs before the branch's artifact-aware failure and N/A merges. - src/skillevaluator/tier3/harbor/runner.py: an explicit agent import path may be a native plugin wrapper or a custom backend's wrapper; agent import paths and the arm base paths are resolved inside main's backend error handling before native plugin wrappers are chosen. The arm base for a custom backend is the backend's own agent wrapper (else the stock agent), as build_harbor_run_command launches it, so a native wrapper over an unknown base falls back or refuses. - src/skillevaluator/evaluation/tier3_report.py: both helper sets kept. Lift data uses main's type check and the branch's activation-aware intervals; dimensions take main's judge_lift and the branch's baseline N/A flag; evaluators keep lift None without a comparison (main's judge exclusion included). When judge-mixed cases exist, the effectiveness headline (or the legacy members comparison) and its basis come from the matching-judge comparison (#212), the case-weighted interval that pairs those cases is dropped, partial and never-activated comparisons still get no lift, and the lift note says when no matching- judge comparison remains. Main's _dimension_score calls use the branch's weighted_dimension_score. - src/skillevaluator/reporting/cli.py: the branch's None-safe evaluator table renders a missing score, baseline or lift as main's "n/a". - tests/reporting/test_reporters.py: both test sets kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Closes #214.
Summary
Installed packages can now add an
--env-modethat runs Tier 3 on infrastructure Harbor does not ship: a custom execution backend. Teams can use an internal sandbox service without forking SkillEvaluator or giving up its policy checks.SPECis anEnvironmentBackendSpec. It names a HarborBaseEnvironmentclass and declares:--ekkwargs;SkillEvaluator passes the class to
harbor run --env <import path>. Harbor 0.24 supports this, and SkillEvaluator already uses it forlocal,docker, andgke.Custom execution backends follow the same policy as Harbor-native backends:
harbor.runtime_envcannot set them.KUBECONFIGis allowed.doctorchecks required kwargs, then runs the backend'sprerequisiteshook, then the class's Harborpreflight(). Load, factory, and preflight failures are redacted.SkillEvaluatorGatewayCodex); otherwise the run stops before trials start.docker-compose.yamlare rejected unless the backend setssupports_docker_compose=True.SKILLEVALUATOR_DISABLE_CUSTOM_BACKENDS=1ignores all of them.Isolated sandbox.With no custom backends installed, the CLI surface and every built-in mode behave exactly as before. The golden CLI surface test is unchanged.
Changes
tier3_environments.py:EnvironmentBackendSpec, discovery, and loading. Stdlib only, so--helpstill imports nothing from Harbor.tier3/harbor/runner.py: custom backend handling at each env-mode branch.cli.py: custom backends appear in the--env-modechoices.docs/agents-and-sandboxes.mdxthat covers what a backend must provide (pinned Harbor, staged image, workspace, verifier artifacts, cleanup) and the baseline/with-skill acceptance run. Also a pointer indocs/cli-reference.mdxand a CHANGELOG entry.Verification
tests/test_custom_execution_backends.py(59): registry, policy, redaction, wrapper resolution, duplicate claims, and path anchoring.tests/test_custom_backend_package.py(3): builds and installs a separate backend wheel, then checks discovery,doctor, and Harbor's import-path dispatch from fresh processes.make lintmake test: 13,752 passed, 27 skipped, 2 failed. The 2 failures (test_harbor_secure_docker_environment.py::test_sidecar_retains_*structurally_required_nonsecret*) fail the same way on unchangedmainon my macOS machine.make buildRelease Impact
CHANGELOG.md🤖 Generated with Claude Code