RunRequest objects, discovers tasks through a Benchmark, builds an ExecutionPlan for each semantic attempt, and executes that plan through the shared runtime. The runtime persists evaluated attempts as task details and aggregates those details into a request summary.
From request to result and ownership
ModelSpec. A Model is a request value describing an endpoint and inference settings. The runtime component registry discovers Benchmark, Harness, Environment, Recipe, and Analyzer implementations; its source location appears in the Source Map.
The exact Environment close point depends on evaluation_environment_mode: evaluation may run in the task Environment, without an Environment, or in a fresh Environment. Cleanup remains in finally paths in all three cases.
Place policy in the component that owns it. For example, a Benchmark may request isolated evaluation through its plan, but Environment code owns how a sandbox is opened and closed, while the runtime owns when those operations occur.
Execution scopes. AgentCompass has two nested units that should not be conflated:
- An attempt is one of the Benchmark’s
kexecutions. The runtime callsPlanner.planonce at the start of each attempt, so every attempt receives a newly resolved plan. - A runtime retry repeats failed work within that same attempt according to
ExecutionSpec.max_retriesandretry_pattern_list. It reuses the already resolvedExecutionPlan; it does not callPlanner.planagain.
RunResult is the execution-level object returned by a Harness or harness-free Benchmark. Benchmark.evaluate turns it into an evaluated attempt, _run_attempts groups evaluated attempts into one task record, and UnifiedEvaluationRuntime.finalize aggregates task records into the request result.
Invariants to preserve
- Import shared contracts from
agentcompass.runtime; do not couple one extension to another extension’s private module. - Treat planning as deterministic. Sandbox creation, network calls, package installation, and file mutation belong to explicit lifecycle phases.
- Preserve compatible explicit user values when defaults or Recipes fill missing settings.
- Enforce network, filesystem, resource, and secret boundaries in the runtime or Environment provider, not in prompts.
- Preserve the distinction between run errors, evaluation errors, valid zero scores, and skipped work.
- Record enough resolved state to explain a result, and keep secrets redacted at every persistence boundary.
Continue by task
When implementing a new component, continue with Benchmark Integration, Harness Integration, or Environment Integration. When preparing a change for review, use the General Contributing Workflow.
