AprilNEA/OpenLogi · error

relationship verification failed: fixture directory name…

Error message

relationship verification failed: fixture directory name must equal manifest id {fixture_id:?}

What it means

`require_directory_id` enforces the fixture-layout invariant that the directory name of a fixture must equal the `id` declared in its manifest. When the on-disk directory name and the manifest id diverge, relationship verification fails because cross-references between fixtures would resolve to the wrong directory.

Solutions

  1. Rename the fixture directory to exactly the manifest `id` value.
  2. Alternatively, update the manifest `id` to match the existing directory name, fixing any cross-references to the old id.
  3. Fix any relationship metadata in other fixtures that points at the old id.
  4. Re-run `openlogi fixture verify`.

Example fix

// before (manifest)
id = "bolt-dpi"
// directory: bolt_dpi/
// after
mv bolt_dpi bolt-dpi   # directory name now equals manifest id
Defensive patterns

Strategy: validation

Validate before calling

let id: String = toml::from_str::<Manifest>(&std::fs::read_to_string(dir.join("manifest.toml"))?)?.id;
assert_eq!(dir.file_name().unwrap().to_str(), Some(id.as_str()), "dir name must equal manifest id");

Prevention

When it happens

Trigger: Running `openlogi fixture verify` (`load` -> `require_directory_id`) on a fixture directory whose `file_name()` differs from the manifest's `id` string — e.g. the directory was renamed but the manifest id was not updated, or vice versa.

Common situations: Renaming a fixture folder without editing the manifest (or renaming the id without renaming the folder); a merge or copy created a directory named differently from its manifest; a typo introduced during a new fixture's creation.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of AprilNEA/OpenLogi@e846e6f4b4 (2026-09-13). Data as JSON: /api/errors/815f5534a7f8a321. Report an issue: GitHub.

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/fixture/verify.rs:183

        bail!("relationship verification failed: missing declared fixture case file {missing:?}");
    }
    Ok(found.into_values().collect())
}

fn case_file_name(case_name: &str) -> Result<String> {
    if matches!(case_name, "." | "..") || case_name.contains('/') || case_name.contains('\\') {
        bail!(
            "relationship verification failed: fixture case name {case_name:?} is not a safe file name"
        );
    }
    Ok(format!("{case_name}.json"))
}

fn require_directory_id(directory: &Path, fixture_id: &str) -> Result<()> {
    if directory.file_name().and_then(|name| name.to_str()) == Some(fixture_id) {
        Ok(())
    } else {
        bail!(
            "relationship verification failed: fixture directory name must equal manifest id {fixture_id:?}"
        )
    }
}

fn read_json<T: DeserializeOwned>(path: &Path, asset: &str) -> Result<T> {
    let bytes = fs::read(path).with_context(|| {
        format!(
            "fixture structure verification failed: could not read {asset} {}",
            path.display()
        )
    })?;
    serde_json::from_slice(&bytes)
        .with_context(|| format!("schema verification failed while parsing {asset}"))
}

fn read_directory(directory: &Path, asset: &str) -> Result<Vec<DirEntry>> {
    let mut entries = fs::read_dir(directory)

View on GitHub (pinned to e846e6f4b4)