{"record":{"id":"3de90277a6c8ca3c","repo":"JuliusBrussee/caveman","slug":"cache-replay-output-directory-must-be-new-w","errorCode":null,"errorMessage":"cache-replay: output directory must be new: %w","messagePattern":"cache-replay: output directory must be new: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cache-replay/main.go","lineNumber":440,"sourceCode":"\treturn result, nil\n}\n\nfunc validEnvironmentName(value string) bool {\n\tif value == \"\" || len(value) > 128 {\n\t\treturn false\n\t}\n\tfor index, char := range value {\n\t\tif char == '_' || char >= 'A' && char <= 'Z' || index > 0 && char >= '0' && char <= '9' {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc createEvidenceDirectory(path string) error {\n\tif err := os.Mkdir(path, 0o700); err != nil {\n\t\treturn fmt.Errorf(\"cache-replay: output directory must be new: %w\", err)\n\t}\n\tfor _, name := range []string{\"responses\", \"quality\", \"evidence\", \"observations\"} {\n\t\tif err := os.Mkdir(filepath.Join(path, name), 0o700); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc atomicWrite(path string, body []byte) error {\n\treturn atomicWriteStream(path, func(writer io.Writer) error {\n\t\t_, err := writer.Write(body)\n\t\treturn err\n\t})\n}\n\nfunc atomicWriteStream(path string, write func(io.Writer) error) error {\n\tdirectory := filepath.Dir(path)","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cmd/cache-replay/main.go#L422-L458","documentation":"Error \"cache-replay: output directory must be new: %w\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cmd/cache-replay/main.go:440 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point -output at a new, non-existent directory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}