{"record":{"id":"569e31f96528ed34","repo":"JuliusBrussee/caveman","slug":"parse-manifest-w","errorCode":null,"errorMessage":"parse manifest: %w","messagePattern":"parse manifest: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/evals/harness.go","lineNumber":103,"sourceCode":"\tTokenRatio   float64         `json:\"token_ratio\"`\n\tWordsBefore  int             `json:\"words_before\"`\n\tWordsAfter   int             `json:\"words_after\"`\n\tWordRatio    float64         `json:\"word_ratio\"`\n\tProbes       ProbeSummary    `json:\"probes\"`\n\tQuality      *QualitySummary `json:\"quality,omitempty\"`\n\tFixtures     []FixtureReport `json:\"fixtures\"`\n}\n\n// Run replays the embedded fixture set behind its graders and returns the\n// report. It runs the engine's configured quality gate.\nfunc Run() (Report, error) {\n\tvar m Manifest\n\traw, err := fixturesFS.ReadFile(\"fixtures/manifest.yaml\")\n\tif err != nil {\n\t\treturn Report{}, fmt.Errorf(\"read manifest: %w\", err)\n\t}\n\tif err := yaml.Unmarshal(raw, &m); err != nil {\n\t\treturn Report{}, fmt.Errorf(\"parse manifest: %w\", err)\n\t}\n\tread := func(name string) ([]byte, error) {\n\t\treturn fixturesFS.ReadFile(\"fixtures/\" + name)\n\t}\n\treturn RunManifest(m, read)\n}\n\n// RunDir replays a caller-supplied fixture directory containing manifest.yaml.\n// Manifest file paths are slash-separated, relative, and confined to root even\n// through symlinks; a custom empty corpus is a configuration error, never green.\nfunc RunDir(root string) (Report, error) {\n\tresolvedRoot, err := filepath.EvalSymlinks(root)\n\tif err != nil {\n\t\treturn Report{}, fmt.Errorf(\"resolve fixture directory: %w\", err)\n\t}\n\tmanifestRaw, err := os.ReadFile(filepath.Join(resolvedRoot, \"manifest.yaml\"))\n\tif err != nil {\n\t\treturn Report{}, fmt.Errorf(\"read manifest: %w\", err)","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/engine/evals/harness.go#L85-L121","documentation":"The embedded fixtures/manifest.yaml could not be parsed as YAML into the Manifest struct. This is a build-input problem: the shipped manifest no longer matches the Manifest schema (unknown/renamed fields with strict decoding, wrong types, or malformed YAML).","triggerScenarios":"evals.Run() reading a manifest.yaml edited by hand or by a codegen step so that yaml.Unmarshal fails — bad indentation, a field typed differently than the struct (string where int expected), or duplicate keys.","commonSituations":"Editing fixtures/manifest.yaml without running the evals locally; a generator regenerating the manifest in a new format; schema evolution where fields were renamed without updating the manifest.","solutions":["Run `go run ./cmd/caveman-engine evals run` locally — the wrapped YAML error gives line/column.","Validate the YAML (yamllint or a parser) against the Manifest struct fields.","Regenerate or fix the manifest to match the current Manifest schema.","Add a CI step that runs the evals so manifest breakage is caught before release."],"exampleFix":"# before: field renamed in schema\nfixtures:\n  - name: x\n    file: x.txt\n\n# after: match Manifest field tags exactly (check struct tags)\nfixtures:\n  - name: x\n    path: x.txt","handlingStrategy":"validation","validationCode":"func manifestParses(path string) error {\n    raw, err := os.ReadFile(path)\n    if err != nil { return err }\n    var m evals.Manifest\n    return yaml.Unmarshal(raw, &m)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the evals locally whenever you touch manifest.yaml.","Lint YAML (yamllint) in CI.","Regenerate the manifest with the same tooling that produced the schema."],"tags":["evals","yaml","manifest","schema"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}