JuliusBrussee/caveman · error

read fixture

Error message

read fixture %q: %w

What it means

Wraps the read() of a manifest-referenced fixture file in runManifestWithSystem. The fixture entry names a file the reader cannot deliver (missing from the embedded FS or disk, or rejected by the path-confinement closure in RunDir).

Solutions

  1. Verify the fixture file exists at the manifest-declared path
  2. Fix path typos or escaping paths flagged by the RunDir confinement checks
  3. Rebuild the binary if embedded fixtures are missing
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at engine/evals/harness.go:222 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/7f7558eb9ea8c60b. Report an issue: GitHub.

Appendix: source

Thrown at engine/evals/harness.go:222

	return runManifestWithSystem(ctx, m, read, system, opts)
}

func runManifest(ctx context.Context, m Manifest, read func(name string) ([]byte, error), quality *QualityOptions) (Report, error) {
	store, err := ccr.OpenMemory()
	if err != nil {
		return Report{}, fmt.Errorf("open recovery store: %w", err)
	}
	defer store.Close()
	eng := engine.New(store, nil)
	return runManifestWithSystem(ctx, m, read, engineSystem{eng: eng}, quality)
}

func runManifestWithSystem(ctx context.Context, m Manifest, read func(name string) ([]byte, error), system TransformRunner, quality *QualityOptions) (Report, error) {
	report := Report{Passed: true}
	for _, f := range m.Fixtures {
		input, err := read(f.File)
		if err != nil {
			return Report{}, fmt.Errorf("read fixture %q: %w", f.File, err)
		}
		res, err := system.Transform(ctx, f, input)
		if err != nil {
			return Report{}, fmt.Errorf("compress fixture %q: %w", f.Name, err)
		}
		subject := Subject{
			Input:         input,
			Output:        res.Output,
			Ratio:         res.Ratio,
			ContentType:   res.ContentType,
			Method:        res.Method,
			PassedThrough: res.PassedThrough,
		}
		fr := FixtureReport{
			Name:            f.Name,
			ContentType:     res.ContentType,
			TokensBefore:    res.TokensBefore,
			TokensAfter:     res.TokensAfter,

View on GitHub (pinned to 766dce6b13)