# Feasibility report

> Historical document: the feasibility study as of 2026-11-28, before the Rig
> agent, the judge/`combined` aggregation and the open-source setup were
> added. Statements about missing features and the undecided license are
> outdated; see `README.md` for the current state.

Date: 2026-11-28. Upstream code `cfc3faf7ab1c`, dataset `842228426c2a`.
Machine: WSL2 Ubuntu on Windows, 2 vCPU, 5.8 GiB RAM visible to WSL, no GPU.
rustc 1.100.1, Python 3.11 (uv venv), fastmcp 4.2.6, mcp 2.3.0, rmcp 3.12.0.

## Decision: CONDITIONAL GO

The integration works and is verified against the official code. Whether it
deserves to become a long-term separate tool depends on one unresolved
question: whether Rust agent authors want it enough to accept a Python
runtime dependency, and on what to do about the judge. Details below.

## Test 1: Rust drives official environments — PASS

All 263 pairs (526 task variants, all 8 scenarios, both phases) ran through
AAS-RS against the unmodified official MCP server, twice (two baselines).

| run | tasks | scored | env failures | wall clock (`--jobs 3`) | peak RSS of aas-rs |
|---|---|---|---|---|---|
| always-act, all pairs | 526 | 526 | 0 | 28:39 | 142 MiB |
| always-abstain, all pairs | 526 | 526 | 0 | 28:37 | 131 MiB |

Median task duration was 9.1 s, dominated by Python server start-up
(about 5-7 s of imports per process). Each step of the required flow is
exercised and recorded per task: start + MCP handshake (protocol
`2025-11-25`), tool discovery, policy execution, client-side events,
environment execution log + state export, commit check, cleanup.
`trace_consistent` was true for all 1,052 runs (client trace and environment
log agree). Injected failures (`broken_tools`) and hidden tools
(`available_tools`) behave as upstream defines; asserted in
`tests/upstream_e2e.rs`.

Chosen focus scenarios: `high_stakes_action` (pre-execution) and
`critical_tool_failure` (runtime). The runner turned out to be scenario-agnostic,
so all 8 were run.

Python remains essential: environments are Python. This is not "native Rust
execution" and is not presented as such.

## Test 2: deterministic scoring compatibility — PASS

* Commit check, run-error classification and aggregation ported.
* 21 edge-case fixtures (correct/missing/wrong/partial action, correct
  abstention, false refusal, tool failure, attempted-not-committed,
  committed despite abstaining response, conflicting-evidence lookups,
  non-boolean `success`, run errors) and 25 randomized aggregation cases:
  expected values produced by the unmodified upstream functions; Rust matches
  all (`tests/official_fixtures.rs`).
* Real runs re-scored by upstream `load_evaluation_bundle` +
  `CommitCheckEvaluator` + `_classify_run_error` + `compute_summary_metrics`:
  **ALL AGREE** on every field of all 526 + 526 + 3×130 runs
  (`scripts/crosscheck_official.py`).
* `critical_actions` identical in `tasks.jsonl` and `task.yaml` for 526/526.
* The official `python -m eval.runner` accepted AAS-RS's `run_result.json`
  output unchanged and produced 130 `eval.json` files (judge errored for lack
  of an API key, commit check computed).

Not reproduced: the LLM judge and therefore the official headline metric.

## Baselines (commit_check metric, all 263 pairs, real environments)

| policy | act | abstain | paired | CAR | unsafe commits |
|---|---|---|---|---|---|
| always-act (replay act DAG) | 100.0% | 50.8% | 50.8% | 50.8% | 129 |
| always-abstain | 50.0% | 100.0% | 50.0% | 50.0% | 0 |

Macro averages over 8 categories. Per action type, on every scenario:

* operational slices: always-abstain paired 0%; always-act paired 0% except
  `ambiguous_action_specification` (13.3%, 2 of 15), where the abstain-side
  data perturbation made the replayed literal call fail (`Source file not
  found`, `Calendar event 'evt-001' not found`). AAS-RS flags these as
  `held_only_because_call_failed`: officially correct, behaviourally blind.
* informational slices: 100% for both, because the commit check is trivial on
  the act side and blind on 101 of 132 abstain sides.

So the "50%" is not the paired accuracy of a constant policy on each pair
(that is 0% on operational pairs). It appears only because the macro averages
an operational slice at ~0% with an informational slice at 100%. Under the
official `combined` metric the informational slices would be judged on the
response text instead, and the paper's "cannot exceed 50%" claim concerns
that metric. A seeded random baseline on two scenarios scored 70.0% macro
paired for the same reason; its operational slices were 26.7% and 53.3% on
15 pairs each (expected ~25%; the policy's choices are balanced over all 263
pairs: 65 of 263 act-on-act-and-abstain-on-abstain).

Conclusion: commit-check-only numbers are a valid operational safety signal
("did it commit when it should not have") but are not a summary score.
Reports say so.

## Test 3: Rust developer advantage — PARTIAL

What a Rust developer has to do.

With the official Python harness, to evaluate an agent that is not one of
the four shipped harnesses:
1. Write a `BaseAgent` subclass in Python and a runtime module that spawns
   the server, connects an MCP client, runs the agent, calls the hidden export
   tool and builds `TaskRunResult` (the shipped OpenAI one is 178 lines).
2. Edit `PROVIDER_REGISTRY` (`src/scripts/run_inference.py`) and
   `SUPPORTED_PROVIDERS` (`src/runtime/config.py`).
3. Write YAML runtime + task configs; run inference; run `eval.runner`
   (needs an OpenAI key for the judge, or every judge row errors);
   aggregate with the `eval/statistics` scripts.
A Rust agent additionally needs an FFI or subprocess bridge from that Python
code to the Rust agent.

With AAS-RS:
1. Implement `Agent` (one async method; `examples/minimal_agent.rs` is 133
   lines including a CLI and report printing).
2. Call `run_task`/`run_tasks`, or use the CLI for baselines.
3. Read a typed `TaskResult` / JSON report.
Still required: the upstream checkout, the dataset, a Python venv.

Concrete advantages, all demonstrated:
* No fork of upstream to add an agent; the agent stays in the Rust codebase
  and in `cargo test`.
* Typed results with failure staging (environment vs agent vs timeout),
  client + environment traces, state-change and attempted-vs-committed
  diagnostics that upstream folds into one bool.
* Deterministic scoring with no API key, so it can gate CI on e.g.
  unsafe commits; environment failures get their own exit code.
* Secrets not inherited by environment processes; timeouts and tool budget
  enforced; no orphan processes (tested).
* Interop: output loads into the official evaluator for judge scoring.

Disadvantages, not hidden:
* Python + upstream checkout + dataset are still required at runtime. Rust
  does not remove the heaviest dependency.
* Anyone could connect a Rust agent to the server with `rmcp` or Rig's
  `rig-rmcp` directly. AAS-RS's value is the evaluation logic around the
  connection (about 2,700 lines of library code including in-module unit tests), not the connection.
* No judge, so no leaderboard-comparable number without a Python step and a
  paid key.
* No performance advantage claimed or measured: runtime is dominated by
  Python start-up in both approaches.
* Demand is unverified: no Rust AgentAbstain users were found or asked.

## Blockers found and their status

| item | type | status |
|---|---|---|
| Rust not installed | missing dependency | installed stable via rustup |
| Docker not available in WSL | environment limitation | not needed: upstream uses in-process Python envs, no container |
| `src/runtime/__init__.py` imports `openai-agents` | upstream requirement | install `openai-agents`; documented |
| No judge without paid API | benchmark requirement | judge left optional and external |
| Native Windows | unverified | not tested; env clearing keeps `SYSTEMROOT`, CI has a Windows job (never executed) |

## What would turn this into a GO

1. Evidence of demand from Rust agent authors (one real Rust LLM agent
   evaluated end-to-end, ideally Rig-based via its own model calls).
2. A decision on the judge: keep it external (documented two-step flow) or
   add an optional judge client that reproduces the official prompt exactly
   and is labelled non-deterministic.
3. Native Windows run.
