---
title: "Grounded Agency Benchmark Suite"
description: "This benchmark suite empirically validates the three core claims of Grounded Agency: Grounding improves accuracy when sources conflict; Checkpointing enables recovery when mutations fail..."
canonical: "https://acs.synapti.ai/background/research/benchmarks/"
last_updated: "2026-11-12T21:12:50+01:00"
---

# Grounded Agency Benchmark Suite

Source: [benchmarks/README.md](https://github.com/synaptiai/agent-capability-standard/blob/main/benchmarks/README.md), commit 18c38b74ac21.

> Reproducible scenarios for validating that Grounded Agency provides measurable benefits over naive agent implementations.

## Overview

This benchmark suite empirically validates the three core claims of Grounded Agency:

1. **Grounding improves accuracy** when sources conflict
2. **Checkpointing enables recovery** when mutations fail
3. **Typed contracts catch errors** before runtime

Each scenario compares a **baseline implementation** (naive/common approach) against a **Grounded Agency implementation** using real SDK components (`CapabilityRegistry`, `CheckpointTracker`, `EvidenceStore`).

```mermaid
---
title: What each scenario compares
---
flowchart LR
  accDescr: Each scenario compares a baseline implementation, the naive or common approach, with a Grounded Agency implementation that uses real SDK components, CapabilityRegistry, CheckpointTracker and EvidenceStore.
  s[Scenario] --> b["Baseline: naive or common approach"]
  s --> ga[Grounded Agency implementation]
  ga --> sdk["Real SDK components: CapabilityRegistry, CheckpointTracker, EvidenceStore"]
```

**Figure: What each scenario compares.** Each scenario compares a baseline implementation, the naive or common approach, with a Grounded Agency implementation that uses real SDK components, CapabilityRegistry, CheckpointTracker and EvidenceStore.

- Scenario → Baseline: naive or common approach
- Scenario → Grounded Agency implementation
- Grounded Agency implementation → Real SDK components: CapabilityRegistry, CheckpointTracker, EvidenceStore

## Quick Start

```bash
# Run all benchmarks
python benchmarks/runner.py

# Run a specific scenario
python benchmarks/runner.py --scenario conflicting_sources

# Generate comparison report
python benchmarks/runner.py --report

# Run benchmark tests
pytest benchmarks/tests/ -v
```

## SDK Integration

The GA paths use real SDK components instead of inline simulation:

| Scenario | SDK Component | Purpose |
|----------|--------------|---------|
| Capability Gap | `CapabilityRegistry` | Loads real `requires` edges from ontology |
| Mutation Recovery | `CheckpointTracker` | Full create/validate/consume lifecycle |
| Conflicting Sources | `EvidenceStore` | Evidence anchor collection and tracking |
| Workflow Type Error | `safe_yaml_load` | Loads coercions from canonical registry |

This prevents drift — ontology changes automatically propagate to benchmarks.

## Scenarios

| # | Scenario | Tests | Baseline Approach | GA Approach |
|---|----------|-------|-------------------|-------------|
| 1 | [Conflicting Sources](#scenario-1-conflicting-sources) | Grounding | Last-write-wins | Trust-weighted resolution |
| 2 | [Mutation Failure Recovery](#scenario-2-mutation-recovery) | Reversibility | Manual recovery | Checkpoint + rollback |
| 3 | [Decision Audit](#scenario-3-decision-audit) | Explainability | No/hallucinated explanation | Evidence anchor traversal |
| 4 | [Workflow Type Error](#scenario-4-workflow-type-error) | Typed contracts | Runtime crash | Design-time detection |
| 5 | [Capability Gap Detection](#scenario-5-capability-gap) | Dependency graph | Runtime failure | Pre-execution blocking |

## Metrics

Each scenario measures:

| Metric | Description |
|--------|-------------|
| **Accuracy** | Correctness compared to ground truth |
| **Recovery Rate** | Successful state restoration after failure |
| **Detection Rate** | Errors caught before runtime |
| **Faithfulness** | Explanation matches actual reasoning |
| **Time to Detection** | When errors are caught (design vs. runtime) |

## Implementation Structure

**Figure: Directory tree: Implementation Structure.** 6 top-level entries in benchmarks/ and 5 directories in all, each marked with the folder glyph; the text after a name is the source's comment on it.

```
benchmarks/
├── README.md                      # This file
├── runner.py                      # Test harness and report generation
├── scenarios/
│   ├── __init__.py                # Scenario registry
│   ├── base.py                    # BenchmarkScenario ABC
│   ├── conflicting_sources.py     # Scenario 1 (uses EvidenceStore)
│   ├── mutation_recovery.py       # Scenario 2 (uses CheckpointTracker)
│   ├── decision_audit.py          # Scenario 3
│   ├── workflow_type_error.py     # Scenario 4 (loads coercion registry)
│   └── capability_gap.py          # Scenario 5 (uses CapabilityRegistry)
├── fixtures/
│   ├── mock_apis.json             # API response fixtures
│   └── workflows/                 # Test workflow definitions
├── tests/
│   ├── __init__.py
│   ├── conftest.py                # Shared fixtures (registry, paths)
│   └── test_scenarios.py          # Unit and integration tests
└── results/
    └── .gitkeep                   # Results directory (artifacts)
```

## Running Benchmarks

### Prerequisites

```bash
# Ensure in project root
cd agent-capability-standard

# Activate virtual environment
source .venv/bin/activate

# Install dependencies
pip install -e ".[dev]"
```

### Full Suite

```bash
python benchmarks/runner.py
```

### Individual Scenarios

```bash
# Run specific scenario with verbose output
python benchmarks/runner.py --scenario conflicting_sources --verbose

# Run with custom iteration count
python benchmarks/runner.py --scenario mutation_recovery --iterations 50
```

### Generate Report

```bash
# Generate markdown report
python benchmarks/runner.py --report --output results/benchmark_report.md

# Generate JSON metrics
python benchmarks/runner.py --report --format json --output results/metrics.json
```

## Extending the Suite

### Adding a New Scenario

```mermaid
---
title: Adding a scenario
---
flowchart TB
  accDescr: A new scenario module in scenarios/ subclasses BenchmarkScenario and defines setup, which prepares the fixtures, run_baseline and run_ga, which execute each approach and return metrics, and compare, which takes both results and returns the improvement. The scenario is then registered in scenarios/__init__.py and documented in this README.
  subgraph mod["1. scenarios/new_scenario.py"]
    setup[setup]
    rb[run_baseline] --> cmp["compare: improvement"]
    rg[run_ga] --> cmp
  end
  cmp --> reg["2. Register in scenarios/__init__.py"] --> doc[3. Document in this README]
```

**Figure: Adding a scenario.** A new scenario module in scenarios/ subclasses BenchmarkScenario and defines setup, which prepares the fixtures, run_baseline and run_ga, which execute each approach and return metrics, and compare, which takes both results and returns the improvement. The scenario is then registered in scenarios/__init__.py and documented in this README.

- Group "1. scenarios/new_scenario.py": setup, run_baseline, compare: improvement, run_ga
- run_baseline → compare: improvement
- run_ga → compare: improvement
- compare: improvement → 2. Register in scenarios/__init__.py
- 2. Register in scenarios/__init__.py → 3. Document in this README
- setup (not linked)

1. Create scenario module in `scenarios/`:

```python
# scenarios/new_scenario.py
from .base import BenchmarkScenario


class NewScenario(BenchmarkScenario):
    name = "new_scenario"
    description = "Tests new aspect of GA"

    def setup(self):
        """Prepare test fixtures"""
        pass

    def run_baseline(self):
        """Execute baseline approach"""
        return {"metric": value}

    def run_ga(self):
        """Execute Grounded Agency approach"""
        return {"metric": value}

    def compare(self, baseline_result, ga_result):
        """Compare and return metrics"""
        return {"improvement": ga_result["metric"] - baseline_result["metric"]}
```

2. Register in `scenarios/__init__.py`
3. Document in this README

## Interpretation Guidelines

### Scenario 1 (Conflicting Sources)

- Baseline picks a winner at random, so its accuracy tracks the coin flip
- GA should beat the baseline by a wide margin; the trust model is working when
  trust-weighted resolution recovers cases the coin flip loses
- Sources use diverse types (high-trust vs low-trust) to exercise weighting
- Ground truth deliberately includes a stale-but-authoritative vs
  fresh-but-weak branch, so the result is sensitive to the decay curve in
  `schemas/authority_trust_model.yaml`

Run the scenario for the current measured figures rather than relying on a
number quoted here:

```bash
python benchmarks/runner.py --scenario conflicting_sources
```

### Scenario 2 (Mutation Recovery)

- **0% baseline recovery** is expected (no checkpoint = no recovery)
- **100% GA recovery** demonstrates checkpoint/rollback pattern via `CheckpointTracker`

```mermaid
---
title: Why the two recovery rates differ
---
flowchart LR
  accDescr: When a mutation fails, the baseline has no checkpoint, so it cannot recover and 0% recovery is expected; the Grounded Agency path has a checkpoint from CheckpointTracker and rolls back to it, so 100% recovery is expected.
  fail[A mutation fails] --> b["Baseline: no checkpoint"] --> nr["No recovery: 0% expected"]
  fail --> ga["GA: checkpoint via CheckpointTracker"] --> rb[Rollback] --> r["Recovered: 100% expected"]
```

**Figure: Why the two recovery rates differ.** When a mutation fails, the baseline has no checkpoint, so it cannot recover and 0% recovery is expected; the Grounded Agency path has a checkpoint from CheckpointTracker and rolls back to it, so 100% recovery is expected.

- A mutation fails → Baseline: no checkpoint
- Baseline: no checkpoint → No recovery: 0% expected
- A mutation fails → GA: checkpoint via CheckpointTracker
- GA: checkpoint via CheckpointTracker → Rollback
- Rollback → Recovered: 100% expected

### Scenario 3 (Decision Audit)

- **Faithfulness < 50%** indicates confabulation
- **Faithfulness = 100%** indicates reliable audit trails from evidence anchors

### Scenario 4 (Workflow Type Error)

- **Detection at design-time** = GA working correctly
- **Coercion suggestions** loaded from canonical `transform_coercion_registry.yaml`

### Scenario 5 (Capability Gap)

- **Prevented failures** = workflows blocked before execution
- Dependency graph loaded from `CapabilityRegistry` (real `requires` edges)
- Self-correcting: ontology changes automatically propagate

```mermaid
---
title: When scenarios 4 and 5 catch an error
---
flowchart LR
  accDescr: For a workflow with a type error, the baseline crashes at runtime and Grounded Agency detects the error at design time; for a workflow with a missing dependency, the baseline fails at runtime and Grounded Agency blocks the workflow before it executes, using the requires edges CapabilityRegistry loads.
  te[Type error] --> crash["Baseline: runtime crash"]
  te --> design["GA: detected at design time"]
  gap[Missing dependency] --> fail["Baseline: runtime failure"]
  gap --> block["GA: blocked before execution, by requires edges"]
```

**Figure: When scenarios 4 and 5 catch an error.** For a workflow with a type error, the baseline crashes at runtime and Grounded Agency detects the error at design time; for a workflow with a missing dependency, the baseline fails at runtime and Grounded Agency blocks the workflow before it executes, using the requires edges CapabilityRegistry loads.

- Type error → Baseline: runtime crash
- Type error → GA: detected at design time
- Missing dependency → Baseline: runtime failure
- Missing dependency → GA: blocked before execution, by requires edges

## Known Limitations

1. **Synthetic scenarios**: Real-world complexity may differ
2. **Trust weight calibration**: Default weights from authority_trust_model.yaml, not production-tuned
3. **LLM-as-judge variance**: Faithfulness scores may vary across models
4. **Determinism**: Some scenarios involve randomness (controlled via seed)

## Related Documentation

- [Failure Taxonomy](https://acs.synapti.ai/background/research/failure-taxonomy/index.md) - Informs scenario selection
- [Capability Ontology](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/capability_ontology.yaml) - Defines GA primitives
- [Trust Model](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/authority_trust_model.yaml) - Conflict resolution weights
- [Workflow DSL](https://acs.synapti.ai/workflows/patterns/index.md) - Composition patterns

---

**Status**: SDK-integrated | **Last Updated**: 2026-02-03
