AprilNEA/OpenLogi · error

fixture structure verification failed: unexpected entry

Error message

fixture structure verification failed: unexpected entry {name:?} in {}

What it means

Fixture `verify` inspects a fixture directory and expects exactly the known top-level entries (e.g. the profile manifest and the fixture-cases directory), each of the right type. `inspect` bails when it encounters any other entry name, enforcing a closed, known fixture layout. It throws because an unrecognized entry means the fixture was created or edited outside the tool's schema and may be corrupt.

Solutions

  1. Remove or move the unexpected entry out of the fixture directory (the error names it: {name:?} at the path shown)
  2. Rename the entry to the expected constant (e.g. the canonical cases directory name) if it was misnamed
  3. Re-record or re-export the fixture with the current tool version if the layout itself changed
  4. Check .gitignore/extraction settings so auxiliary files never land inside the fixture folder

Example fix

// before
fixture-dir/
  manifest.toml
  cases/
  scratch-notes.md      <- unexpected entry
// after
fixture-dir/
  manifest.toml
  cases/
Defensive patterns

Strategy: validation

Validate before calling

# pre-check: only the known entries should exist
ls fixture-dir | grep -v -E '^(manifest\.toml|cases)$' && echo "unexpected entries present — clean before verify"

Try / catch

match verify(fixture_dir) {
    Err(e) if e.to_string().starts_with("fixture structure verification failed: unexpected entry") => {
        let name = extract_entry_name(&e); // move/delete it, then retry
        remove_or_relocate(fixture_dir.join(name));
        verify(fixture_dir)
    }
    other => other,
}

Prevention

When it happens

Trigger: Running fixture verification over a directory that contains an unexpected file or subdirectory next to the manifest and cases directory — e.g. stray `notes.txt`, editor backup files, a `cassettes/` folder with a different name, or an OS artifact like `.DS_Store` if it is not filtered.

Common situations: Hand-copying fixture folders and dragging in extra files; a git-ignored scratch file landing inside the fixture; renaming the cases directory so its constant (CASES_DIRECTORY) no longer matches; extracting an archive that added top-level metadata files.

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/805783ac916f6ecd. Report an issue: GitHub.

Appendix: source

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

        let mut manifest = None;
        let mut profile = None;
        let mut cases = None;
        for entry in read_directory(directory, "fixture directory")? {
            let name = entry_name(&entry)?;
            match name.as_str() {
                MANIFEST_FILE => {
                    require_regular_file(&entry, "fixture manifest")?;
                    manifest = Some(entry.path());
                }
                PROFILE_FILE => {
                    require_regular_file(&entry, "device profile")?;
                    profile = Some(entry.path());
                }
                CASES_DIRECTORY => {
                    require_entry_directory(&entry, "fixture cases directory")?;
                    cases = Some(entry.path());
                }
                _ => bail!(
                    "fixture structure verification failed: unexpected entry {name:?} in {}",
                    directory.display()
                ),
            }
        }
        Ok(Self {
            manifest: manifest.context(
                "fixture structure verification failed: fixture directory has no manifest.json",
            )?,
            profile: profile.context(
                "fixture structure verification failed: fixture directory has no profile.json",
            )?,
            cases,
        })
    }
}

fn load_cassettes(

View on GitHub (pinned to e846e6f4b4)