zeroclaw-labs/zeroclaw · error

no *.json trace fixtures found in {}

Error message

no *.json trace fixtures found in {}

What it means

`run_suite` scans the directory for `*.json` trace fixtures via `load_suite` and bails when none are found, so an empty suite cannot silently produce a passing report. Only the exact `.json` extension counts. The message prints the directory path that was actually searched.

Source

Thrown at crates/zeroclaw-eval/src/runner.rs:29

use crate::Mode;
use crate::case::{LlmTrace, load_suite};
use crate::grader::evaluate_expects;
use crate::observer::RecordingObserver;
use crate::record::RunRecord;
use crate::replay::TraceLlmProvider;
use crate::report::{CaseReport, SuiteReport};
use crate::tools::default_tools;

/// Run every `*.json` trace fixture in `dir` and return an aggregated report.
pub async fn run_suite(dir: &Path, mode: Mode) -> anyhow::Result<SuiteReport> {
    if mode == Mode::Live {
        anyhow::bail!("live mode is not implemented yet (Phase 0 supports --mode replay only)");
    }

    let traces = load_suite(dir)?;
    if traces.is_empty() {
        anyhow::bail!("no *.json trace fixtures found in {}", dir.display());
    }

    let mut cases = Vec::with_capacity(traces.len());
    for (path, trace) in traces {
        let name = trace.model_name.clone();
        let source = path
            .file_name()
            .and_then(|f| f.to_str())
            .unwrap_or("<unknown>")
            .to_string();

        let report = match run_case(&trace).await {
            Ok(record) => CaseReport {
                name,
                source,
                grades: evaluate_expects(&trace.expects, &record),
                error: None,
            },

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. List the directory and confirm `*.json` files exist at that exact path
  2. Record or export one JSON trace fixture per case into the directory
  3. Rename non-`.json` fixture files to `.json` if they are actually JSON traces

Example fix

# before — empty/wrong directory
zeroclaw-eval --mode replay ./traces
# after — directory that contains case1.json, case2.json
zeroclaw-eval --mode replay ./tests/fixtures/traces
Defensive patterns

Strategy: validation

Validate before calling

use std::path::Path;

fn has_json_fixtures(dir: &Path) -> bool {
    dir.read_dir()
        .map(|rd| {
            rd.filter_map(Result::ok)
                .any(|e| e.path().extension().is_some_and(|x| x == "json"))
        })
        .unwrap_or(false)
}

if !has_json_fixtures(&dir) {
    anyhow::bail!("no trace fixtures in {} — record some before running", dir.display());
}

Prevention

When it happens

Trigger: Passing a directory with no `.json` files; a typo'd path that exists but holds fixtures elsewhere; fixtures saved as `.jsonl` or `.txt`; a directory containing only subdirectories.

Common situations: First run before any traces are recorded; pointing at the repo root instead of the fixtures directory; CI checkouts that skip large fixture artifacts.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/04a285ef711aae56. Report an issue: GitHub.